fixed the memory leaks in htp and radix tree

remotes/origin/master-1.0.x
Gurvinder Singh 16 years ago committed by Victor Julien
parent 7a6d4b57f0
commit a0fa924c15

@ -644,6 +644,8 @@ void HtpBodyFree(HtpBody *body)
prev = body->first;
while (prev != NULL) {
cur = prev->next;
if (prev->data != NULL)
SCFree(prev->data);
SCFree(prev);
prev = cur;
}
@ -716,12 +718,12 @@ void HTPFreeConfig(void)
HTPCfgRec *nextrec = cfglist.next;
SCRadixReleaseRadixTree(cfgtree);
SCFree(cfglist.cfg);
htp_config_destroy(cfglist.cfg);
while (nextrec != NULL) {
HTPCfgRec *htprec = nextrec;
nextrec = nextrec->next;
SCFree(htprec->cfg);
htp_config_destroy(htprec->cfg);
SCFree(htprec);
}
SCReturn;

@ -456,6 +456,8 @@ static void SCRadixReleasePrefix(SCRadixPrefix *prefix, SCRadixTree *tree)
tree->Free(user_data_temp2->user);
SCRadixDeAllocSCRadixUserData(user_data_temp2);
}
} else if (user_data_temp1 != NULL) {
SCFree(user_data_temp1);
}
SCFree(prefix);

Loading…
Cancel
Save