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.
remotes/origin/master
Eric Leblond 13 years ago committed by Victor Julien
parent 480db00fd7
commit 01c7e5bde6

@ -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;
}
}

Loading…
Cancel
Save