asn1: fix memory leak

As reported in issue #1395, fix 2 memory leaks when destroying
asn.1 decode contexts.
pull/1842/head
Jason Ish 11 years ago committed by Victor Julien
parent 96ed8d90ee
commit 18760e222a

@ -373,13 +373,15 @@ void SCAsn1CtxDestroy(Asn1Ctx *ac)
if (ac == NULL)
return;
uint16_t i = 0;
for (; i < ac->cur_frame; i++) {
for (uint16_t i = 0; i < asn1_max_frames_config; i++) {
Asn1Node *node = ASN1CTX_GET_NODE(ac, i);
if (node != NULL) {
SCFree(node);
if (node == NULL) {
break;
}
SCFree(node);
}
SCFree(ac->asn1_stack);
SCFree(ac);
}

Loading…
Cancel
Save