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

ChangeLog
lib/xgetdomainname.h

index 9073c377f29553c17032f3bbd82421b24c5e04e1..0cb5d613eb30b56edaa246a1b19a6e21abd1507a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       xgetdomainname: Improve GCC 11 allocation-deallocation checking.
+       * lib/xgetdomainname.h: Include <stdlib.h>.
+       (xgetdomainname): Declare that deallocation must happen through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        xgetdomainname: Ensure .c file starts with '#include <config.h>'.
index 2ac9819daa4767f44aa422a8ab2773509f3c1542..389a9fc079714384a9bd90a9ae5b5b931f08d752 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef _XGETDOMAINNAME_H
 #define _XGETDOMAINNAME_H
 
+#include <stdlib.h>
+
 /* Return the NIS domain name of the machine, in malloc'd storage.
    WARNING! The NIS domain name is unrelated to the fully qualified host name
             of the machine.  It is also unrelated to email addresses.
@@ -25,6 +27,7 @@
             not using NIS.
    If malloc fails, exit.
    Upon any other failure, set errno and return NULL.  */
-extern char *xgetdomainname (void);
+extern char *xgetdomainname (void)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 #endif /* _XGETDOMAINNAME_H */