]> Savannah Git Hosting - gnulib.git/commitdiff
canon-host: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:21:19 +0000 (19:21 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:21:19 +0000 (19:21 +0200)
* lib/canon-host.h: Include <stdlib.h>.
(canon_host, canon_host_r): Declare that deallocation must happen
through 'free'.

ChangeLog
lib/canon-host.h

index 0d2b8e9c3aa4176bcd44c43883c6de5dd420b096..a4827f31a3f7660898cf6cb4ee78021ecd22e9a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       canon-host: Improve GCC 11 allocation-deallocation checking.
+       * lib/canon-host.h: Include <stdlib.h>.
+       (canon_host, canon_host_r): Declare that deallocation must happen
+       through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        c-xvasprintf: Improve GCC 11 allocation-deallocation checking.
index fb35bfeb9961ddebec36cd94441e51ff5899705c..28919253af6a19072f67ee2c9bf47b280c9806e5 100644 (file)
 #ifndef CANON_HOST_H
 # define CANON_HOST_H 1
 
-char *canon_host (char const *host) _GL_ATTRIBUTE_MALLOC;
-char *canon_host_r (char const *host, int *cherror) _GL_ATTRIBUTE_MALLOC;
+# include <stdlib.h>
+
+char *canon_host (char const *host)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+char *canon_host_r (char const *host, int *cherror)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 const char *ch_strerror (void);
 # define ch_strerror_r(cherror) gai_strerror (cherror);