summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2011-05-16 21:29:45 +0000
committerJohannes Schlüter <johannes@php.net>2011-05-16 21:29:45 +0000
commit38c1181cfab762136a35aed793a8c785d5d4a56f (patch)
treeba7e301d38d8de883522369debfb8bbb3d2b974e /ext
parent2957b7cbb64216f3575b76642efeb71110b4a803 (diff)
downloadphp-git-38c1181cfab762136a35aed793a8c785d5d4a56f.tar.gz
- Fix a few more memleaks found by parfait
Diffstat (limited to 'ext')
-rw-r--r--ext/date/lib/parse_tz.c3
1 files changed, 3 insertions, 0 deletions
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++) {