From 570e0ec9e4d218e25ae0bc3b9729ea3cb68dbe13 Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Tue, 31 May 2011 20:28:08 -0500 Subject: [PATCH] Fix potential memory leak in ASN1 parsing code in low memory conditions --- src/util-decode-asn1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util-decode-asn1.c b/src/util-decode-asn1.c index b1ac363a19..0fd7739fc9 100644 --- a/src/util-decode-asn1.c +++ b/src/util-decode-asn1.c @@ -346,6 +346,7 @@ Asn1Ctx *SCAsn1CtxNew(void) { ac->asn1_stack = SCMalloc(sizeof(Asn1Node *) * asn1_max_frames_config); if (ac->asn1_stack == NULL) { + SCFree(ac); return NULL; } memset(ac->asn1_stack, 0, sizeof(Asn1Node *) * asn1_max_frames_config);