From cc5b1eca12f7cb65350211f218ff2af98c1a6d87 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 1 Aug 2021 17:44:46 -0700 Subject: [PATCH] xgetcwd: improve -fanalyzer malloc checking --- ChangeLog | 2 +- lib/xgetcwd.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eef494f381..fa2b09d2da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,7 @@ * 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/system-quote.h: - * lib/trim.h: + * lib/trim.h, lib/xgetcwd.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/xgetcwd.h b/lib/xgetcwd.h index 98d1d1a4fe..eca195e8ec 100644 --- a/lib/xgetcwd.h +++ b/lib/xgetcwd.h @@ -14,4 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -extern char *xgetcwd (void); +#include + +extern char *xgetcwd (void) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; -- 2.39.5