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; return sm;
} }
/** \brief free a SigMatch
* \param sm SigMatch to free.
*/
void SigMatchFree(SigMatch *sm) { void SigMatchFree(SigMatch *sm) {
if (sm == NULL) if (sm == NULL)
return; return;
if (sigmatch_table[sm->type].Free != NULL) { /** free the ctx, for that we call the Free func */
sigmatch_table[sm->type].Free(sm); if (sm->ctx != NULL) {
if (sigmatch_table[sm->type].Free != NULL) {
sigmatch_table[sm->type].Free(sm->ctx);
}
} }
free(sm); free(sm);
} }

Loading…
Cancel
Save