From: Johannes Schlüter Date: Mon, 16 May 2011 21:29:45 +0000 (+0000) Subject: - Fix a few more memleaks found by parfait X-Git-Tag: php-5.4.0alpha1~176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f7d022eead2192efaf03fc72524c6031e3f4664;p=php - Fix a few more memleaks found by parfait --- diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index 99ef7a88c0..b8d8448c94 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -100,6 +100,7 @@ static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz) 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 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz) tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo)); if (!tz->type) { + free(buffer); return; } @@ -153,6 +155,7 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz) tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo)); if (!tz->leap_times) { + free(leap_buffer); return; } for (i = 0; i < tz->leapcnt; i++) {