Skip to content

Commit 99f3e0f

Browse files
committed
Fix PKCS12 leak in openssl
1 parent c939a67 commit 99f3e0f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/openssl/openssl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,8 +3029,6 @@ PHP_FUNCTION(openssl_pkcs12_read)
30293029
}
30303030

30313031
RETVAL_TRUE;
3032-
3033-
PKCS12_free(p12);
30343032
} else {
30353033
php_openssl_store_errors();
30363034
}
@@ -3045,6 +3043,9 @@ PHP_FUNCTION(openssl_pkcs12_read)
30453043
if (cert) {
30463044
X509_free(cert);
30473045
}
3046+
if (p12) {
3047+
PKCS12_free(p12);
3048+
}
30483049
}
30493050
/* }}} */
30503051

0 commit comments

Comments
 (0)