]> Savannah Git Hosting - gnulib.git/commitdiff
xgetcwd: improve -fanalyzer malloc checking
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Aug 2021 00:44:46 +0000 (17:44 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Aug 2021 01:06:57 +0000 (18:06 -0700)
ChangeLog
lib/xgetcwd.h

index eef494f381a87edd79ab5761c3dae656077f1997..fa2b09d2da4e69129da1a89b5c89edaba50848a1 100644 (file)
--- 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.
index 98d1d1a4fe6f0c1af18b2e9a85659b6c9942330b..eca195e8ecc93a2c8afe1cc2ec5120e368400b1d 100644 (file)
@@ -14,4 +14,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-extern char *xgetcwd (void);
+#include <stdlib.h>
+
+extern char *xgetcwd (void)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;