Merge "Fix a leak on error in tzload."

This commit is contained in:
Elliott Hughes 2014-02-28 02:16:40 +00:00 committed by Gerrit Code Review
commit e334540516

View File

@ -371,9 +371,8 @@ tzload(register const char* name, register struct state* const sp,
goto oops; goto oops;
int toread; int toread;
fid = __bionic_open_tzdata(name, &toread); fid = __bionic_open_tzdata(name, &toread);
if (fid < 0) { if (fid < 0)
return -1; goto oops;
}
nread = read(fid, up->buf, toread); nread = read(fid, up->buf, toread);
if (close(fid) < 0 || nread <= 0) if (close(fid) < 0 || nread <= 0)
goto oops; goto oops;