From patchwork Sun Sep 9 15:26:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 29279 Received: (qmail 108678 invoked by alias); 9 Sep 2018 15:26:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 108572 invoked by uid 89); 9 Sep 2018 15:26:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*edu X-HELO: zimbra.cs.ucla.edu From: Paul Eggert To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 2/2] Simplify tzfile fstat failure code Date: Sun, 9 Sep 2018 08:26:10 -0700 Message-Id: <20180909152610.4602-2-eggert@cs.ucla.edu> In-Reply-To: <20180909152610.4602-1-eggert@cs.ucla.edu> References: <20180909152610.4602-1-eggert@cs.ucla.edu> [BZ #21716] * time/tzfile.c (__tzfile_read): Simplify slightly. --- ChangeLog | 4 ++++ time/tzfile.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f95da9ce2..1b768dc17a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2018-09-09 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 ea6e940303..72ef75f074 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;