From 5156ad4f7bc8d39cced93ebe59f4165c5da016c9 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 29 Mar 2021 17:45:03 +1300 Subject: [PATCH] Remove unnecessary NULL check SWIG_remove() calls either free() or delete, both of which handle a NULL pointer. --- Source/Modules/php.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index c8c02dc7a..bb0df5850 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -135,7 +135,7 @@ static void print_creation_free_wrapper(int item_index) { Printf(s_header, " obj = php_fetch_object(object);\n\n"); if (need_free) { - Printf(s_header, " if(obj->ptr && obj->newobject)\n"); + Printf(s_header, " if(obj->newobject)\n"); Printf(s_header, " SWIG_remove((%s *)obj->ptr);\n",class_type); }