summaryrefslogtreecommitdiffstats
path: root/gl/free.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/free.c')
-rw-r--r--gl/free.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gl/free.c b/gl/free.c
index 98ceafd7..e6e7cf0f 100644
--- a/gl/free.c
+++ b/gl/free.c
@@ -1,6 +1,6 @@
1/* Make free() preserve errno. 1/* Make free() preserve errno.
2 2
3 Copyright (C) 2003, 2006, 2009-2025 Free Software Foundation, Inc. 3 Copyright (C) 2003, 2006, 2009-2026 Free Software Foundation, Inc.
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
@@ -33,7 +33,7 @@ rpl_free (void *p)
33{ 33{
34# if defined __GNUC__ && !defined __clang__ 34# if defined __GNUC__ && !defined __clang__
35 /* An invalid GCC optimization 35 /* An invalid GCC optimization
36 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396> 36 <https://gcc.gnu.org/PR98396>
37 would optimize away the assignments in the code below, when link-time 37 would optimize away the assignments in the code below, when link-time
38 optimization (LTO) is enabled. Make the code more complicated, so that 38 optimization (LTO) is enabled. Make the code more complicated, so that
39 GCC does not grok how to optimize it. */ 39 GCC does not grok how to optimize it. */
@@ -44,9 +44,9 @@ rpl_free (void *p)
44 free (p); 44 free (p);
45 errno = err[errno == 0]; 45 errno = err[errno == 0];
46# else 46# else
47 int err = errno; 47 int saved_errno = errno;
48 free (p); 48 free (p);
49 errno = err; 49 errno = saved_errno;
50# endif 50# endif
51} 51}
52 52