]> granicus.if.org Git - php/commitdiff
Fixed another memory leak, patch provided by Ilia <ilia@prohost.org>
authorDan Kalowsky <kalowsky@php.net>
Tue, 13 Aug 2002 23:12:54 +0000 (23:12 +0000)
committerDan Kalowsky <kalowsky@php.net>
Tue, 13 Aug 2002 23:12:54 +0000 (23:12 +0000)
ext/standard/pack.c

index 8c02b8573f4275d0acbf92ba24459fdcac6b1678..3d47e0609cb18086eab7525252687cad27042418 100644 (file)
@@ -521,7 +521,7 @@ PHP_FUNCTION(unpack)
        inputpos = 0;
 
        if (array_init(return_value) == FAILURE)
-               return;
+               RETURN_FALSE;
 
        while (formatlen-- > 0) {
                char type = *(format++);
@@ -812,6 +812,7 @@ PHP_FUNCTION(unpack)
                                break;
                        } else {
                                php_error(E_WARNING, "pack type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos);
+                               zval_dtor(return_value);
                                RETURN_FALSE;
                        }
                }