From: Paul Eggert Date: Tue, 18 Sep 2018 22:02:11 +0000 (-0700) Subject: Simplify tzfile fstat failure code X-Git-Tag: glibc-2.29~452 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dab9c3488e86d5304f3e4b778933760374494a82;p=thirdparty%2Fglibc.git Simplify tzfile fstat failure code [BZ #21716] * time/tzfile.c (__tzfile_read): Simplify slightly. --- diff --git a/ChangeLog b/ChangeLog index 5d8c0353906..0be5afdaa0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2018-09-18 Paul Eggert + Simplify tzfile fstat failure code + [BZ #21716] + * time/tzfile.c (__tzfile_read): Simplify slightly. + Fix tzfile low-memory assertion failure [BZ #21716] * time/tzfile.c (__tzfile_read): Check for memory exhaustion diff --git a/time/tzfile.c b/time/tzfile.c index ea6e9403039..72ef75f074c 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -168,10 +168,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap) /* Get information about the file we are actually using. */ if (fstat64 (__fileno (f), &st) != 0) - { - fclose (f); - goto ret_free_transitions; - } + goto lose; free ((void *) transitions); transitions = NULL;