diff options
author | Elliott Hughes <enh@google.com> | 2014-02-27 17:04:38 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-02-27 17:04:38 -0800 |
commit | 3073f90b17b1d2899b036e2c45ba5324f8c34298 (patch) | |
tree | 30e8014759965fdef25ea659c3418ae3adcf38f0 /libc/tzcode | |
parent | 000ffd8ab0b4112173ce319869f4111f08fbe975 (diff) | |
download | android_bionic-3073f90b17b1d2899b036e2c45ba5324f8c34298.tar.gz android_bionic-3073f90b17b1d2899b036e2c45ba5324f8c34298.tar.bz2 android_bionic-3073f90b17b1d2899b036e2c45ba5324f8c34298.zip |
Fix a leak on error in tzload.
Change-Id: Ib5d9aaa7a618e478ce8e5e82f967cf535bb1a5a3
Diffstat (limited to 'libc/tzcode')
-rw-r--r-- | libc/tzcode/localtime.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index e2599b439..202f031af 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c @@ -371,9 +371,8 @@ tzload(register const char* name, register struct state* const sp, 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; |