Message ID | 20250105055750.1668721-40-eggert@cs.ucla.edu (mailing list archive) |
---|---|
State | New |
Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB7B83858C51 for <patchwork@sourceware.org>; Sun, 5 Jan 2025 06:43:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB7B83858C51 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C header.b=ACWQpiY8 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id 22E623858414 for <libc-alpha@sourceware.org>; Sun, 5 Jan 2025 05:59:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 22E623858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 22E623858414 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=131.179.128.66 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736056796; cv=none; b=Lpk3e2i5zi7QA6ZnW58vJC4u7ELCmYTzdTP0wtXRmyeY9b0EhhMiCdaFzb951t5kKWJSqFH0UumhdqWh483KSJbAxQksQdswJ+QAG3iXZgf/cp7qwBbEMf1ou6bzVSFZmv68U/t9zt04Db+YwabN2aQMRB7D7wtMfuyV12iwS6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736056796; c=relaxed/simple; bh=OYubJBNtwLpBRIAN9kdvbMCZzn+oHVRtkjgQ6OyqVdQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=F+RE8iECmayRKecZO3+lxbwvVPRwVf/i26e7Hoc07bZ1nn3P8nPuPFPrFue8nFXL0XeNLo4sneR0kvsHzae+RTOGmreDNimaSXjwrIg8LZJYwierPYA3ZkPK+xL+6FrhYWrKTKVyUXV0cviZoh17uBkuUd3sf9wnfjuzZGlSE4A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22E623858414 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 9CFC23C123845 for <libc-alpha@sourceware.org>; Sat, 4 Jan 2025 21:59:55 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id U09BHGQ89rjL; Sat, 4 Jan 2025 21:59:55 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 5E2583C123844; Sat, 4 Jan 2025 21:59:55 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 5E2583C123844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1736056795; bh=uosd6B/mbOD+KmXFZO64o//cjgLwBxejtaeuJNXV2/g=; h=From:To:Date:Message-ID:MIME-Version; b=ACWQpiY8kpF+EvaTl92OoH2O43PS9MZgi2rDI+Le5SsEqoyCHgplVg1kBBHikiEs2 gCQQ96fKSA3HflJBb4Ywqpsd47F1DAMQ4+sonPrw4k4C104tf2pB2orh8xvT9lbpFm iH2A8YO4E2TRH2r1Sy71CcWydYU9GTScAEKiXZwVeZr6KuoPli9C6dfTGVggCTp+wx K1vrm8phlgf1/7w6LJvxDP9/E3nlCaVYH2YMCjUuwTBy4SQKmL1nXCTejDhOH5BXx5 jPBoiUYc+Ko7Jul9QbTt6GOtXnkteCwgtaFtC0risYXG7B4CIMZ9Yb/cHLv8MncFUL E+pWQ//xEqsrQ== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id yebEHtoql9TW; Sat, 4 Jan 2025 21:59:55 -0800 (PST) Received: from wing.home (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 472063C082EB9; Sat, 4 Jan 2025 21:59:55 -0800 (PST) From: Paul Eggert <eggert@cs.ucla.edu> To: libc-alpha@sourceware.org Cc: Paul Eggert <eggert@cs.ucla.edu> Subject: [PATCH 39/59] Free earlier in __tzfile_read Date: Sat, 4 Jan 2025 21:57:14 -0800 Message-ID: <20250105055750.1668721-40-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.45.2 In-Reply-To: <01207110-bd60-46ae-9c08-fb39c2011067@cs.ucla.edu> References: <01207110-bd60-46ae-9c08-fb39c2011067@cs.ucla.edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
Series |
time: sync mktime from Gnulib
|
|
Checks
Context | Check | Description |
---|---|---|
redhat-pt-bot/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Paul Eggert
Jan. 5, 2025, 5:57 a.m. UTC
* time/tzfile.c (__tzfile_read): Free NEW earlier, to help the heap manager and remove the need for a goto. --- time/tzfile.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/time/tzfile.c b/time/tzfile.c index 09ebc7d8ea..d600b88e89 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -202,11 +202,15 @@ __tzfile_read (const char *file) && __stat64_time64 (file, &st) == 0 && tzfile_ino == st.st_ino && tzfile_dev == st.st_dev && tzfile_mtime == st.st_mtime) - goto done; /* Nothing to do. */ + { + free (new); + return true; + } /* Note the file is opened with cancellation in the I/O functions disabled and if available FD_CLOEXEC set. */ f = fopen (file, "rce"); + free (new); if (f == NULL) goto ret_free_transitions; off_t f_offset = 0; @@ -576,14 +580,11 @@ __tzfile_read (const char *file) tzfile_ino = st.st_ino; tzfile_mtime = st.st_mtime; - done: - free (new); return true; lose: fclose (f); ret_free_transitions: - free (new); free (transitions); transitions = NULL; tzfile_mtime = 0;