Intended to find issues in opaque object destructors.
Closes GH-6251.
--- /dev/null
+--TEST--
+Try to instantiate all classes without arguments
+--FILE--
+<?php
+
+foreach (get_declared_classes() as $class) {
+ try {
+ new $class;
+ } catch (Throwable) {}
+}
+
+?>
+===DONE===
+--EXPECT--
+===DONE===
static void php_gd_image_object_free(zend_object *intern)
{
php_gd_image_object *img_obj_ptr = php_gd_exgdimage_from_zobj_p(intern);
- gdImageDestroy(img_obj_ptr->image);
- img_obj_ptr->image = NULL;
-
+ if (img_obj_ptr->image) {
+ gdImageDestroy(img_obj_ptr->image);
+ }
zend_object_std_dtor(intern);
}
{
php_openssl_pkey_object *key_object = php_openssl_pkey_from_obj(object);
- EVP_PKEY *pkey = key_object->pkey;
- assert(pkey != NULL);
- EVP_PKEY_free(pkey);
-
+ EVP_PKEY_free(key_object->pkey);
zend_object_std_dtor(&key_object->std);
}