From 01c7e5bde642078c3690283c8bfb1b7ef73ed42e Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Mon, 19 Dec 2011 10:22:06 +0100 Subject: [PATCH] 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. --- src/util-decode-der.c | 2 ++ 1 file changed, 2 insertions(+) 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; } } -- 2.47.2