[ 2990315 ] cmciRelease not called in case of error
diff --git a/ChangeLog b/ChangeLog
index b6d7772..f2b8852 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-23  Narasimha Sharoff  <nsharoff@us.ibm.com>
+
+	* frontend/sfcc/sfcclient.c
+	[ 2990315 ] cmciRelease not called in case of error
+
 2011-03-02  Narasimha Sharoff  <nsharoff@us.ibm.com>
 
 	* TEST/v2*.c
diff --git a/NEWS b/NEWS
index 67133d3..4c96e72 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@
 - 2793377: Missing includes
 - 3101151: SfcbLocal failed to connect due to hardcoded library path
 - 3195267: sfcc v2 tests segfault when sfcb is not running
+- 2990315: cmciRelease not called in case of error
 
 Changes in 2.2.1
 ================
diff --git a/frontend/sfcc/sfcclient.c b/frontend/sfcc/sfcclient.c
index be1345c..2418410 100644
--- a/frontend/sfcc/sfcclient.c
+++ b/frontend/sfcc/sfcclient.c
@@ -109,6 +109,15 @@
     }
   }
   pthread_mutex_unlock(&ConnectionControl.ccMux);
+  if (!cc) {
+    /* cleanup ccEnv after pthread_mutex_unlock */
+    cmciRelease(NULL);
+    if (rc) {
+      rc->rc = CMPI_RC_ERR_FAILED;
+      rc->msg = NULL;
+    }
+  }
+
   return cc;
 }