]> granicus.if.org Git - php/commitdiff
fix leak in assert()
authorAntony Dovgal <tony2001@php.net>
Tue, 8 Aug 2006 17:32:19 +0000 (17:32 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 8 Aug 2006 17:32:19 +0000 (17:32 +0000)
ext/standard/assert.c

index 2a3100464465679d9bb11a8f21177958eb384bc1..eb933ff18afd7ab43644c53f8782f6c9ab932e5f 100644 (file)
@@ -161,6 +161,9 @@ PHP_FUNCTION(assert)
                if (zend_eval_string(myeval, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
                        efree(compiled_string_description);
                        php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+                       if (free_tmp) {
+                               zval_dtor(&tmp);
+                       }
                        if (ASSERTG(bail)) {
                                zend_bailout();
                        }
@@ -180,6 +183,9 @@ PHP_FUNCTION(assert)
        }
 
        if (val) {
+               if (free_tmp) {
+                       zval_dtor(&tmp);
+               }
                RETURN_TRUE;
        }