com php-src: Fix memory leak: ext/gd/libgd/gd_gd2.c
| From: | Stanislav Malyshev | Date: | Wed, 27 Apr 2016 05:54:58 +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-91852@lists.php.net to get a copy of this message | ||
Commit: 61c7a06e7c19d9b408db1129efa0959a0acbf0b1
Author: Stanislav Malyshev <stas@php.net> Tue, 26 Apr 2016 22:54:58 -0700
Parents: dccda88f27a084bcbbb30198ace12b4e7ae961cc
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=61c7a06e7c19d9b408db1129efa0959a0acbf0b1
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;
}
}