From f0bfa2ea1b1e59523ec5c43ca9a1f4ddc55ca26d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Aug 2021 19:21:19 +0200 Subject: [PATCH] canon-host: Improve GCC 11 allocation-deallocation checking. * lib/canon-host.h: Include . (canon_host, canon_host_r): Declare that deallocation must happen through 'free'. --- ChangeLog | 7 +++++++ lib/canon-host.h | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d2b8e9c3a..a4827f31a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible + + canon-host: Improve GCC 11 allocation-deallocation checking. + * lib/canon-host.h: Include . + (canon_host, canon_host_r): Declare that deallocation must happen + through 'free'. + 2021-08-07 Bruno Haible c-xvasprintf: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/canon-host.h b/lib/canon-host.h index fb35bfeb99..28919253af 100644 --- a/lib/canon-host.h +++ b/lib/canon-host.h @@ -20,8 +20,12 @@ #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 + +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); -- 2.39.5