]> Savannah Git Hosting - gnulib.git/commitdiff
xgethostname: improve -fanalyzer malloc checking
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Aug 2021 00:45:24 +0000 (17:45 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Aug 2021 01:06:57 +0000 (18:06 -0700)
ChangeLog
lib/xgethostname.h

index fa2b09d2da4e69129da1a89b5c89edaba50848a1..99d546d9ffff0c58208f1ffcc9cc5a0b7dceec95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,7 +6,7 @@
        * lib/filenamecat.h, lib/malloca.h, lib/modechange.h:
        * lib/mountlist.h, lib/pagealign_alloc.h, lib/quotearg.h:
        * lib/readutmp.h, lib/savedir.h, lib/sh-quote.h, lib/system-quote.h:
-       * lib/trim.h, lib/xgetcwd.h:
+       * lib/trim.h, lib/xgetcwd.h, lib/xgethostname.h:
        Add malloc-related attributes and include stdlib.h as needed.
        * lib/dfa.c: Include verify.h.
        (assume_nonnull): New macro.
index f4be562682adeeb6dc6beacc6cd58b08d849dce7..23d2d61ebe4bee74f95ba3dbfcee1476c70025c5 100644 (file)
@@ -15,4 +15,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-char *xgethostname (void);
+#include <stdlib.h>
+
+char *xgethostname (void)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;