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

index 11c4395b9618c0fbe762c75e53a967726d7fe5fe..45fd8cad547b5c5986b3ec81c0cbf1c337e84404 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,7 +5,7 @@
        * lib/canonicalize.h, lib/dfa.h, lib/dirname.h, lib/exclude.h:
        * lib/filenamecat.h, lib/malloca.h, lib/modechange.h:
        * lib/mountlist.h, lib/pagealign_alloc.h, lib/quotearg.h:
-       * lib/readutmp.h:
+       * lib/readutmp.h, lib/savedir.h:
        Add malloc-related attributes and include stdlib.h as needed.
        * lib/dfa.c: Include verify.h.
        (assume_nonnull): New macro.
index 65cc15af12919e669f9a9299bde76fdf55579167..12dabdb1105b4f32806da99b5b0e6d2840970f3e 100644 (file)
@@ -22,6 +22,7 @@
 #define _GL_SAVEDIR_H
 
 #include <dirent.h>
+#include <stdlib.h>
 
 enum savedir_option
   {
@@ -35,7 +36,9 @@ enum savedir_option
 #endif
   };
 
-char *streamsavedir (DIR *, enum savedir_option);
-char *savedir (char const *, enum savedir_option);
+char *streamsavedir (DIR *, enum savedir_option)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+char *savedir (char const *, enum savedir_option)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 #endif