[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
- [PATCH 01/27] backupfile: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 02/27] maint: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 03/27] dfa: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 04/27] dirname: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 05/27] exclude: improve -fanalyzer malloc checking,
Paul Eggert <=
- [PATCH 06/27] filenamecat-lgpl: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 08/27] modechange: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 07/27] malloca: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 09/27] mountlist: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 10/27] pagalign_alloc: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 11/27] quotearg: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 14/27] sh-quote: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 12/27] readutmp: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01