bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 05/27] exclude: improve -fanalyzer malloc checking


From: Paul Eggert
Subject: [PATCH 05/27] exclude: improve -fanalyzer malloc checking
Date: Sun, 1 Aug 2021 18:17:59 -0700

---
 ChangeLog     | 2 +-
 lib/exclude.h | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 884443438..bac4c5fcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@
 
        maint: improve -fanalyzer malloc checking
        * lib/backup-internal.h, lib/backupfile.h:
-       * lib/canonicalize.h, lib/dfa.h, lib/dirname.h:
+       * lib/canonicalize.h, lib/dfa.h, lib/dirname.h, lib/exclude.h:
        Add malloc-related attributes and include stdlib.h as needed.
        * lib/dfa.c: Include verify.h.
        (assume_nonnull): New macro.
diff --git a/lib/exclude.h b/lib/exclude.h
index 9ecfbc985..8d6581afa 100644
--- a/lib/exclude.h
+++ b/lib/exclude.h
@@ -48,8 +48,11 @@ struct exclude;
 
 bool fnmatch_pattern_has_wildcards (const char *, int) _GL_ATTRIBUTE_PURE;
 
-struct exclude *new_exclude (void) _GL_ATTRIBUTE_MALLOC;
-void free_exclude (struct exclude *);
+void free_exclude (struct exclude *)
+  _GL_ATTRIBUTE_NONNULL ((1));
+struct exclude *new_exclude (void)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_RETURNS_NONNULL
+  _GL_ATTRIBUTE_DEALLOC (free_exclude, 1);
 void add_exclude (struct exclude *, char const *, int);
 int add_exclude_file (void (*) (struct exclude *, char const *, int),
                       struct exclude *, char const *, int, char);
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]