From: Matt Caswell Date: Mon, 22 Aug 2016 21:27:27 +0000 (+0100) Subject: Ensure the mime_hdr_free function can handle NULLs X-Git-Tag: OpenSSL_1_1_0~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=030648cea98faeba94a510ecc6e3d283040eec5c;p=thirdparty%2Fopenssl.git Ensure the mime_hdr_free function can handle NULLs Sometimes it is called with a NULL pointer Reviewed-by: Tim Hudson --- diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index a4527a160ac..d7ec801b1e7 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -918,6 +918,8 @@ static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, const char *name) static void mime_hdr_free(MIME_HEADER *hdr) { + if (hdr == NULL) + return; OPENSSL_free(hdr->name); OPENSSL_free(hdr->value); if (hdr->params)