commit | 3073f90b17b1d2899b036e2c45ba5324f8c34298 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Thu Feb 27 17:04:38 2014 -0800 |
committer | Elliott Hughes <enh@google.com> | Thu Feb 27 17:04:38 2014 -0800 |
tree | 30e8014759965fdef25ea659c3418ae3adcf38f0 | |
parent | 000ffd8ab0b4112173ce319869f4111f08fbe975 [diff] |
Fix a leak on error in tzload. Change-Id: Ib5d9aaa7a618e478ce8e5e82f967cf535bb1a5a3
diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index e2599b4..202f031 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c
@@ -371,9 +371,8 @@ goto oops; int toread; fid = __bionic_open_tzdata(name, &toread); - if (fid < 0) { - return -1; - } + if (fid < 0) + goto oops; nread = read(fid, up->buf, toread); if (close(fid) < 0 || nread <= 0) goto oops;