From 030648cea98faeba94a510ecc6e3d283040eec5c Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 22 Aug 2016 22:27:27 +0100 Subject: [PATCH] Ensure the mime_hdr_free function can handle NULLs Sometimes it is called with a NULL pointer Reviewed-by: Tim Hudson --- crypto/asn1/asn_mime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index a4527a160a..d7ec801b1e 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) -- 2.34.1