modechange: improve -fanalyzer malloc checking
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Aug 2021 00:36:09 +0000 (17:36 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Aug 2021 01:06:55 +0000 (18:06 -0700)
ChangeLog
lib/modechange.h

index 166618a42cd14a08e3087288fbc3c6673d000e80..dded7f2752769253fe783d340c1f889ba1ed0d9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,7 @@
        maint: improve -fanalyzer malloc checking
        * lib/backup-internal.h, lib/backupfile.h:
        * lib/canonicalize.h, lib/dfa.h, lib/dirname.h, lib/exclude.h:
-       * lib/filenamecat.h, lib/malloca.h:
+       * lib/filenamecat.h, lib/malloca.h, lib/modechange.h:
        Add malloc-related attributes and include stdlib.h as needed.
        * lib/dfa.c: Include verify.h.
        (assume_nonnull): New macro.
index 9029fbc61731bbb5537bb5154bf0e47287a8e9c9..e32b3c916c0e64d264782be26c8f394775991b6b 100644 (file)
 # define MODECHANGE_H_
 
 # include <stdbool.h>
+# include <stdlib.h>
 # include <sys/types.h>
 
-struct mode_change *mode_compile (const char *);
-struct mode_change *mode_create_from_ref (const char *);
+struct mode_change *mode_compile (const char *)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+struct mode_change *mode_create_from_ref (const char *)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 mode_t mode_adjust (mode_t, bool, mode_t, struct mode_change const *,
                     mode_t *);