1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00

Fix memory leaks in openssl_cms_encrypt() when push fails

This commit is contained in:
ndossche
2026-01-20 15:21:13 +01:00
committed by ndossche
parent 556ec77951
commit f6887f04f6
+8 -2
View File
@@ -6464,7 +6464,10 @@ PHP_FUNCTION(openssl_cms_encrypt)
goto clean_exit;
}
}
sk_X509_push(recipcerts, cert);
if (sk_X509_push(recipcerts, cert) <= 0) {
php_openssl_store_errors();
goto clean_exit;
}
} ZEND_HASH_FOREACH_END();
} else {
/* a single certificate */
@@ -6484,7 +6487,10 @@ PHP_FUNCTION(openssl_cms_encrypt)
goto clean_exit;
}
}
sk_X509_push(recipcerts, cert);
if (sk_X509_push(recipcerts, cert) <= 0) {
php_openssl_store_errors();
goto clean_exit;
}
}
/* sanity check the cipher */