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

index 6c81691fbabb5c1e8262ca2b977f17cf5dba7dc2..7ef3676a6d5f6a263ca9304bc1db1ad902a10936 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/savedir.h, lib/sh-quote.h:
+       * lib/readutmp.h, lib/savedir.h, lib/sh-quote.h, lib/system-quote.h:
        Add malloc-related attributes and include stdlib.h as needed.
        * lib/dfa.c: Include verify.h.
        (assume_nonnull): New macro.
index f378950e91aae7e37228fe46f0afbb008890562e..b1bbf652168d5405e83b1905898c73d572eb8969 100644 (file)
@@ -47,6 +47,7 @@
  */
 
 #include <stddef.h>
+#include <stdlib.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -84,13 +85,17 @@ extern char *
 /* Returns the freshly allocated quoted string.  */
 extern char *
        system_quote (enum system_command_interpreter interpreter,
-                     const char *string);
+                     const char *string)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+  _GL_ATTRIBUTE_RETURNS_NONNULL;
 
 /* Returns a freshly allocated string containing all argument strings, quoted,
    separated through spaces.  */
 extern char *
        system_quote_argv (enum system_command_interpreter interpreter,
-                          char * const *argv);
+                          char * const *argv)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+  _GL_ATTRIBUTE_RETURNS_NONNULL;
 
 #ifdef __cplusplus
 }