]> granicus.if.org Git - php/commitdiff
Fix memory leak.
authorAndrei Zmievski <andrei@php.net>
Wed, 21 Feb 2001 17:22:26 +0000 (17:22 +0000)
committerAndrei Zmievski <andrei@php.net>
Wed, 21 Feb 2001 17:22:26 +0000 (17:22 +0000)
ext/standard/array.c

index df814317992566cf95483bc37fab88ff5d5f6d02..3ca5559e128b14328485ddaee622662ff6e45cb9 100644 (file)
@@ -1517,6 +1517,7 @@ PHP_FUNCTION(array_push)
        stack = *args[0];
        if (Z_TYPE_P(stack) != IS_ARRAY) {
                php_error(E_WARNING, "First argument to array_push() needs to be an array");
+               efree(args);
                RETURN_FALSE;
        }
 
@@ -1621,6 +1622,7 @@ PHP_FUNCTION(array_unshift)
        stack = *args[0];
        if (Z_TYPE_P(stack) != IS_ARRAY) {
                php_error(E_WARNING, "First argument to array_unshift() needs to be an array");
+               efree(args);
                RETURN_FALSE;
        }