]> granicus.if.org Git - php/commitdiff
Fixed memory leak inside pack() (coverity issues #398,#399,#400)
authorIlia Alshanetsky <iliaa@php.net>
Sat, 22 Sep 2007 15:25:46 +0000 (15:25 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 22 Sep 2007 15:25:46 +0000 (15:25 +0000)
ext/standard/pack.c

index 1e7acac6e12975513e1ac167ce3473bdbefc06e7..161eb31eddbeef9de473d015a0b90479515a1d0d 100644 (file)
@@ -56,6 +56,9 @@
 
 #define INC_OUTPUTPOS(a,b) \
        if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \
+               efree(argv);    \
+               efree(formatcodes);     \
+               efree(formatargs);      \
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \
                RETURN_FALSE; \
        } \