From 38c1181cfab762136a35aed793a8c785d5d4a56f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Schl=C3=BCter?= Date: Mon, 16 May 2011 21:29:45 +0000 Subject: [PATCH] - Fix a few more memleaks found by parfait --- ext/date/lib/parse_tz.c | 3 +++ 1 file changed, 3 insertions(+) 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++) { -- 2.40.0