]> granicus.if.org Git - php/commitdiff
MFB: fix possible segfault
authorNuno Lopes <nlopess@php.net>
Thu, 9 Nov 2006 16:34:00 +0000 (16:34 +0000)
committerNuno Lopes <nlopess@php.net>
Thu, 9 Nov 2006 16:34:00 +0000 (16:34 +0000)
ext/filter/callback_filter.c

index a825a5dc38269bec9b3a4b7585712f49be4e2171..fd8ed2d4cd2b25525a22a554a299a54dcd7f88a7 100644 (file)
@@ -42,15 +42,14 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
                if (retval_ptr != value) {
                        zval_dtor(value);
                        COPY_PZVAL_TO_ZVAL(*value, retval_ptr);
+               } else {
+                       zval_ptr_dtor(&retval_ptr);
                }
        } else {
                zval_dtor(value);
                Z_TYPE_P(value) = IS_NULL;
        }
 
-       if (retval_ptr) {
-               zval_ptr_dtor(&retval_ptr);
-       }
        efree(args);
 }