com php-src: Fix memory leak: ext/gd/libgd/gd_gd2.c

From: Date: Wed, 27 Apr 2016 10:54:09 +0000
Subject: com php-src: Fix memory leak: ext/gd/libgd/gd_gd2.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91873@lists.php.net to get a copy of this message
Commit: 136689d17bce8bb736ad2d784f4fe79881f9a70f Author: Stanislav Malyshev <stas@php.net> Tue, 26 Apr 2016 22:54:58 -0700 Committer: Anatol Belski <ab@php.net> Wed, 27 Apr 2016 12:54:09 +0200 Parents: 1248079be837808da4c97364fb3b4c96c8015fbf Branches: PHP-5.6.21 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=136689d17bce8bb736ad2d784f4fe79881f9a70f Log: Fix memory leak Changed paths: M ext/gd/libgd/gd_gd2.c Diff: diff --git a/ext/gd/libgd/gd_gd2.c b/ext/gd/libgd/gd_gd2.c index 1794ca9..6726fee 100644 --- a/ext/gd/libgd/gd_gd2.c +++ b/ext/gd/libgd/gd_gd2.c @@ -145,12 +145,15 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in cidx = gdCalloc(sidx, 1); for (i = 0; i < nc; i++) { if (gdGetInt(&cidx[i].offset, in) != 1) { + gdFree(cidx); goto fail1; } if (gdGetInt(&cidx[i].size, in) != 1) { + gdFree(cidx); goto fail1; } if (cidx[i].offset < 0 || cidx[i].size < 0) { + gdFree(cidx); goto fail1; } }

« previous php.cvs (#91873) next »