From: Narasimha S. <nsh...@us...> - 2011-09-23 18:29:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via cef7763a00d57524e2e518efdf8ee7a3290ca84d (commit) from b5bfde178bb0fb8db2f6aa77a8853b5536210d90 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cef7763a00d57524e2e518efdf8ee7a3290ca84d Author: Narasimha Sharoff <nsh...@us...> Date: Thu Sep 22 13:22:12 2011 -0700 [3413031] fixes to perform check before calling free ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index abaa502..698ff67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Narasimha Sharoff <nsh...@us...> + + * providerDrv.c, result.c, support.c + [ 3413031 ] fixes to perform check before calling free + 2011-09-09 Michael Chase-Salerno <br...@li...> * httpAdapter.c, sfcb.cfg.pre.in, control.c: diff --git a/NEWS b/NEWS index 6ff0072..1446b58 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Bugs fixed: - 3101157 Failed to enable provider timing analysis with SfcbLocal - 3400114 sfcb fails to start with ipv6 disabled - 3310192 32bit sfcbmof fails to run x86_64 +- 3413031 fixes to perform check before calling free Changes in 1.4.1 ================ diff --git a/providerDrv.c b/providerDrv.c index 04099da..38f4335 100644 --- a/providerDrv.c +++ b/providerDrv.c @@ -3338,6 +3338,7 @@ processProviderInvocationRequests(char *name) providerSockets.receive, getInode(providerSockets.receive))); parms = (Parms *) malloc(sizeof(*parms)); + memset(parms, 0, sizeof(*parms)); rc = spRecvReq(&providerSockets.receive, &parms->requestor, (void **) &parms->req, &rl, &mqg); diff --git a/result.c b/result.c index f10f65c..3a5edd3 100644 --- a/result.c +++ b/result.c @@ -208,9 +208,9 @@ __rft_release(CMPIResult *result) { NativeResult *nr = (NativeResult *) result; - free(nr->data); - free(nr->resp); - free(result); + if (nr->data) { free(nr->data); nr->data = NULL; } + if (nr->resp) { free(nr->resp); nr->resp = NULL; } + if (result) { free(result); result = NULL; } CMReturn(CMPI_RC_OK); } @@ -335,12 +335,12 @@ __rft_returnInstance(const CMPIResult *result, if (isInst) { size = getInstanceSerializedSize(instance); - ptr = nextResultBufferPos(r, MSG_SEG_INSTANCE, size); + ptr = nextResultBufferPos(r, MSG_SEG_INSTANCE, (unsigned long)size); _SFCB_TRACE(1, ("--- Moving instance %d", size)); getSerializedInstance(instance, ptr); /* memcpy inst to ptr */ } else { size = getConstClassSerializedSize((CMPIConstClass *) instance); - ptr = nextResultBufferPos(r, MSG_SEG_CONSTCLASS, size); + ptr = nextResultBufferPos(r, MSG_SEG_CONSTCLASS, (unsigned long)size); _SFCB_TRACE(1, ("--- Moving class %d", size)); getSerializedConstClass((CMPIConstClass *) instance, ptr); } diff --git a/support.c b/support.c index 801242f..3afb052 100644 --- a/support.c +++ b/support.c @@ -413,11 +413,11 @@ __cleanup_mt(void *ptr) __flush_mt(mt); if (mt->hc.memObjs) - free(mt->hc.memObjs); + { free(mt->hc.memObjs); mt->hc.memObjs = NULL; } if (mt->hc.memEncObjs) - free(mt->hc.memEncObjs); + { free(mt->hc.memEncObjs); mt->hc.memEncObjs = NULL; } - free(mt); + if (mt) { free(mt); mt = NULL; } } _SFCB_EXIT(); } @@ -720,13 +720,16 @@ releaseHeap(void *hc) __flush_mt(mt); if (mt->hc.memObjs) - free(mt->hc.memObjs); + { free(mt->hc.memObjs); mt->hc.memObjs = NULL; } if (mt->hc.memEncObjs) - free(mt->hc.memEncObjs); + { free(mt->hc.memEncObjs); mt->hc.memEncObjs = NULL; } + if (hc) { memcpy(&mt->hc, hc, sizeof(HeapControl)); free(hc); + hc = NULL; + } _SFCB_EXIT(); } hooks/post-receive -- SFCB - Small Footprint CIM Broker |