svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/parse_tz.c branches/PHP_5_4/ext/date/lib/parse_tz.c trunk/ext/date/lib/parse_tz.c
| From: | Johannes Schlüter | Date: | Mon, 16 May 2011 21:29:45 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/parse_tz.c branches/PHP_5_4/ext/date/lib/parse_tz.c trunk/ext/date/lib/parse_tz.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-64953@lists.php.net to get a copy of this message | ||
johannes Mon, 16 May 2011 21:29:45 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=311110
Log:
- Fix a few more memleaks found by parfait
Changed paths:
U php/php-src/branches/PHP_5_3/ext/date/lib/parse_tz.c
U php/php-src/branches/PHP_5_4/ext/date/lib/parse_tz.c
U php/php-src/trunk/ext/date/lib/parse_tz.c
Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_tz.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/date/lib/parse_tz.c 2011-05-16 20:11:00 UTC (rev 311109)
+++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_tz.c 2011-05-16 21:29:45 UTC (rev 311110)
@@ -100,6 +100,7 @@
cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
if (!cbuffer) {
+ free(buffer);
return;
}
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
@@ -125,6 +126,7 @@
tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
if (!tz->type) {
+ free(buffer);
return;
}
@@ -153,6 +155,7 @@
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
if (!tz->leap_times) {
+ free(leap_buffer);
return;
}
for (i = 0; i < tz->leapcnt; i++) {
Modified: php/php-src/branches/PHP_5_4/ext/date/lib/parse_tz.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/date/lib/parse_tz.c 2011-05-16 20:11:00 UTC (rev 311109)
+++ php/php-src/branches/PHP_5_4/ext/date/lib/parse_tz.c 2011-05-16 21:29:45 UTC (rev 311110)
@@ -100,6 +100,7 @@
cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
if (!cbuffer) {
+ free(buffer);
return;
}
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
@@ -125,6 +126,7 @@
tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
if (!tz->type) {
+ free(buffer);
return;
}
@@ -153,6 +155,7 @@
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
if (!tz->leap_times) {
+ free(leap_buffer);
return;
}
for (i = 0; i < tz->leapcnt; i++) {
Modified: php/php-src/trunk/ext/date/lib/parse_tz.c
===================================================================
--- php/php-src/trunk/ext/date/lib/parse_tz.c 2011-05-16 20:11:00 UTC (rev 311109)
+++ php/php-src/trunk/ext/date/lib/parse_tz.c 2011-05-16 21:29:45 UTC (rev 311110)
@@ -100,6 +100,7 @@
cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
if (!cbuffer) {
+ free(buffer);
return;
}
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
@@ -125,6 +126,7 @@
tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
if (!tz->type) {
+ free(buffer);
return;
}
@@ -153,6 +155,7 @@
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
if (!tz->leap_times) {
+ free(leap_buffer);
return;
}
for (i = 0; i < tz->leapcnt; i++) {