Fix error in freeing the ctx of a SigMatch.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 97854cf4bb
commit 0242fad770

@ -58,12 +58,18 @@ SigMatch *SigMatchAlloc(void) {
return sm;
}
/** \brief free a SigMatch
* \param sm SigMatch to free.
*/
void SigMatchFree(SigMatch *sm) {
if (sm == NULL)
return;
if (sigmatch_table[sm->type].Free != NULL) {
sigmatch_table[sm->type].Free(sm);
/** free the ctx, for that we call the Free func */
if (sm->ctx != NULL) {
if (sigmatch_table[sm->type].Free != NULL) {
sigmatch_table[sm->type].Free(sm->ctx);
}
}
free(sm);
}

Loading…
Cancel
Save