]> granicus.if.org Git - php/commitdiff
fix memleak
authorAntony Dovgal <tony2001@php.net>
Fri, 17 Oct 2008 22:09:35 +0000 (22:09 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 17 Oct 2008 22:09:35 +0000 (22:09 +0000)
ext/spl/spl_array.c

index c5b706e1d7c33ad3b4112cf7545e280bd4c132ea..ddc24c5506b26ab362fad88420595b932eb21661 100755 (executable)
@@ -1255,6 +1255,8 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam
        
        if (use_arg) {
                if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+                       Z_TYPE_P(tmp) = IS_NULL;
+                       zval_ptr_dtor(&tmp);
                        zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC);
                        return;
                }