From: Eric Leblond Date: Mon, 19 Dec 2011 09:22:06 +0000 (+0100) Subject: tls-handshake: Add some missing free in error handling. X-Git-Tag: suricata-1.3beta1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01c7e5bde642078c3690283c8bfb1b7ef73ed42e;p=thirdparty%2Fsuricata.git tls-handshake: Add some missing free in error handling. When DecodeAsn1BuildValue function fails, it may be necessary to do some clean-up in the calling functions. --- diff --git a/src/util-decode-der.c b/src/util-decode-der.c index a076263657..363e6bc4db 100644 --- a/src/util-decode-der.c +++ b/src/util-decode-der.c @@ -612,6 +612,7 @@ static Asn1Generic * DecodeAsn1DerSequence(const unsigned char *buffer, uint32_t numbytes = c & 0x7f; d_ptr++; if (DecodeAsn1BuildValue(&d_ptr, &d_length, numbytes) == -1) { + free(node); return NULL; } } @@ -667,6 +668,7 @@ static Asn1Generic * DecodeAsn1DerSet(const unsigned char *buffer, uint32_t max_ numbytes = c & 0x7f; d_ptr++; if (DecodeAsn1BuildValue(&d_ptr, &d_length, numbytes) == -1) { + free(node); return NULL; } }