]> granicus.if.org Git - php/commitdiff
Fixed memory leak
authorDmitry Stogov <dmitry@php.net>
Thu, 14 Feb 2008 08:46:42 +0000 (08:46 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 14 Feb 2008 08:46:42 +0000 (08:46 +0000)
ext/standard/array.c

index 69a552d8b5e5dc3c5da12e115a9f7af51eb91a01..f182600e2cf4fe2f1f520e11bfec4c00dbdc9c6b 100644 (file)
@@ -2092,6 +2092,7 @@ PHP_FUNCTION(array_push)
                Z_ADDREF_P(new_var);
 
                if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var, sizeof(zval *), NULL) == FAILURE) {
+                       Z_DELREF_P(new_var);
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied");
                        efree(args);
                        RETURN_FALSE;