From: Paul Eggert Date: Mon, 2 Aug 2021 00:44:46 +0000 (-0700) Subject: xgetcwd: improve -fanalyzer malloc checking X-Git-Tag: v1.0~2743 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cc5b1eca12f7cb65350211f218ff2af98c1a6d87;p=gnulib.git xgetcwd: improve -fanalyzer malloc checking --- 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;