From 05bb8ebb8fe66819dcdd5546772b07f1b9fed685 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 26 Apr 2025 12:43:36 +0200 Subject: [PATCH] Remove always-false intern checks This pointer derived from zend_object can never be NULL. --- ext/snmp/snmp.c | 4 ---- ext/zip/php_zip.c | 3 --- 2 files changed, 7 deletions(-) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 6cede307ac834..915c4a46e1b12 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -170,10 +170,6 @@ static void php_snmp_object_free_storage(zend_object *object) /* {{{ */ { php_snmp_object *intern = php_snmp_fetch_object(object); - if (!intern) { - return; - } - snmp_session_free(&(intern->session)); zend_object_std_dtor(&intern->zo); diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 187104d2da4ed..97a12dd4d5614 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1047,9 +1047,6 @@ static void php_zip_object_free_storage(zend_object *object) /* {{{ */ ze_zip_object * intern = php_zip_fetch_object(object); int i; - if (!intern) { - return; - } if (intern->za) { if (zip_close(intern->za) != 0) { php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", zip_strerror(intern->za));