Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv9566
Modified Files:
internalProvider.c providerMgr.c ChangeLog NEWS
Log Message:
[ 1901737 ] Memory leak in internalProvider.c
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.705
retrieving revision 1.706
diff -u -d -r1.705 -r1.706
--- NEWS 3 Jul 2012 02:05:01 -0000 1.705
+++ NEWS 3 Jul 2012 02:11:19 -0000 1.706
@@ -7,6 +7,7 @@
- 3539563 Memory leak in indCIMXMLHandler when Reliable Inds Enabled
- 3539557 Memory leak in providerDrv with property list
- 3539555 Memory leak in TestInstanceProvider
+- 1901737 Memory leak in internalProvider.c
Changes in 1.3.15
=================
Index: providerMgr.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- providerMgr.c 11 Apr 2012 22:55:17 -0000 1.82
+++ providerMgr.c 3 Jul 2012 02:11:19 -0000 1.83
@@ -575,6 +575,7 @@
for (child = children->ft->getFirst(children); child;
child = children->ft->getNext(children)) {
rc = addAssocProviders(child, nameSpace, providerList);
+ free(child);
if (rc) _SFCB_RETURN(rc);
}
CMRelease(children);
Index: internalProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/internalProvider.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- internalProvider.c 11 May 2012 20:05:11 -0000 1.44
+++ internalProvider.c 3 Jul 2012 02:11:18 -0000 1.45
@@ -590,6 +590,7 @@
CMPIObjectPath *path;
if (assocForName(ns,assocClass,role,resultRole) == NULL) {
/* for an unknown class we just return nothing */
+ refs->ft->release(refs);
_SFCB_RETURN(st);
}
path=CMNewObjectPath(_broker,ns,assocClass,NULL);
@@ -675,6 +676,7 @@
// Use hashtable to avoid dup'd associators
CMPIInstance *ci;
UtilHashTable *assocs = UtilFactory->newHashTable(61,UtilHashTable_charKey);
+ assocs->ft->setReleaseFunctions(assocs, free, NULL);
UtilStringBuffer *pn=normalizeObjectPathStrBuf(cop);
for (ci=refs->ft->getFirst(refs); ci; ci=refs->ft->getNext(refs)) {
// Q: for ASSOC_NAME we should not require the
@@ -688,9 +690,10 @@
objectPathEquals(pn,data.value.ref,&an,0)==0) {
if (resultClass ==NULL || CMClassPathIsA(Broker,data.value.ref,resultClass,NULL)) {
CMPIInstance *aci=CBGetInstance(Broker,ctx,data.value.ref,propertyList,&st);
- assocs->ft->put(assocs,an->ft->getCharPtr(an),aci);
+ assocs->ft->put(assocs, strdup(an->ft->getCharPtr(an)), aci);
}
}
+ an->ft->release(an);
}
else {
@@ -707,8 +710,9 @@
if (resultClass==NULL || CMClassPathIsA(Broker,ref,resultClass,NULL)) {
CMPIInstance *aci=CBGetInstance(Broker,ctx,ref,propertyList,&st);
- if (aci) assocs->ft->put(assocs,an->ft->getCharPtr(an),aci);
+ if (aci) assocs->ft->put(assocs, strdup(an->ft->getCharPtr(an)), aci);
}
+ an->ft->release(an);
}
}
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.789
retrieving revision 1.790
diff -u -d -r1.789 -r1.790
--- ChangeLog 3 Jul 2012 02:05:01 -0000 1.789
+++ ChangeLog 3 Jul 2012 02:11:19 -0000 1.790
@@ -1,5 +1,8 @@
2012-07-02 Chris Buccella <buc...@li...>
+ * internalProvider.c, providerMgr.c:
+ [ 1901737 ] Memory leak in internalProvider.c
+
* test/TestProviders/cmpiTestInstanceProvider.c:
[ 3539555 ] Memory leak in TestInstanceProvider
|