Ack from me (not tested). Please remember to also update the samples copy of immutils. Done by just copying over the opensaf internal h and c files.
Both copies can be pushed in the same patch. /AndersBj -----Original Message----- From: Zoran Milinkovic [mailto:[email protected]] Sent: den 21 augusti 2014 16:20 To: [email protected] Cc: [email protected] Subject: [devel] [PATCH 1 of 1] immtools: fix memory release of object names when CCB data is deleted [#1001] osaf/tools/safimm/src/immutil.c | 15 ++++++++------- samples/immsv/immutils/immutil.c | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) When there are more CCBs in CcbUtilCcbData, the first call of ccbutil_deleteCcbData() free all object names from active CCBs. The patch fix this problem, and release object names only for the certain CCB. diff --git a/osaf/tools/safimm/src/immutil.c b/osaf/tools/safimm/src/immutil.c --- a/osaf/tools/safimm/src/immutil.c +++ b/osaf/tools/safimm/src/immutil.c @@ -112,19 +112,20 @@ void ccbutil_deleteCcbData(struct CcbUti if (ccb == NULL) return; while (item != NULL) { - op = item->operationListHead; - while(op) { - osaf_extended_name_free(&op->objectName); - op = op->next; - if(op == item->operationListTail) - break; - } if (ccb->ccbId == item->ccbId) { if (prev == NULL) { ccbList = item->next; } else { prev->next = item->next; } + + op = item->operationListHead; + while(op) { + osaf_extended_name_free(&op->objectName); + op = op->next; + if(op == item->operationListTail) + break; + } } prev = item; item = item->next; diff --git a/samples/immsv/immutils/immutil.c b/samples/immsv/immutils/immutil.c --- a/samples/immsv/immutils/immutil.c +++ b/samples/immsv/immutils/immutil.c @@ -112,19 +112,20 @@ void ccbutil_deleteCcbData(struct CcbUti if (ccb == NULL) return; while (item != NULL) { - op = item->operationListHead; - while(op) { - osaf_extended_name_free(&op->objectName); - op = op->next; - if(op == item->operationListTail) - break; - } if (ccb->ccbId == item->ccbId) { if (prev == NULL) { ccbList = item->next; } else { prev->next = item->next; } + + op = item->operationListHead; + while(op) { + osaf_extended_name_free(&op->objectName); + op = op->next; + if(op == item->operationListTail) + break; + } } prev = item; item = item->next; ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
