diff --git a/src/common/dpp_crypto.c b/src/common/dpp_crypto.c index 37c2b692b..c75fc7871 100644 --- a/src/common/dpp_crypto.c +++ b/src/common/dpp_crypto.c @@ -2868,6 +2868,7 @@ struct wpabuf * dpp_pkcs7_certs(const struct wpabuf *pkcs7) res = BIO_read(out, wpabuf_put(pem, 0), rlen); if (res <= 0) { wpabuf_free(pem); + pem = NULL; goto fail; } wpabuf_put(pem, res);