diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 2de093595d0d2e45962a78adf23ece83ee188f1d..173045be21eacf25b9dc60e7c72ddb7f16401d92 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -957,7 +957,9 @@ int PEM_read_bio_ex(BIO *bp, char **name_out, char **header, *data = pem_malloc(len, flags); if (*header == NULL || *data == NULL) { pem_free(*header, flags, 0); + *header = NULL; pem_free(*data, flags, 0); + *data = NULL; goto end; } BIO_read(headerB, *header, headerlen);