From 0ff708092058a3c467437f624ff07f6672585177 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 1 Aug 2021 17:24:52 -0700 Subject: [PATCH] maint: improve -fanalyzer malloc checking * lib/canonicalize.h: --- ChangeLog | 1 + lib/canonicalize.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f63846d2b2..1af0b926ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ maint: improve -fanalyzer malloc checking * lib/backup-internal.h, lib/backupfile.h: + * lib/canonicalize.h: Add malloc-related attributes and include stdlib.h as needed. 2021-08-01 Jim Meyering diff --git a/lib/canonicalize.h b/lib/canonicalize.h index f3054d42fe..1f7a5fdff5 100644 --- a/lib/canonicalize.h +++ b/lib/canonicalize.h @@ -48,7 +48,8 @@ typedef enum canonicalize_mode_t canonicalize_mode_t; Whether components must exist or not depends on canonicalize mode. The result is malloc'd. Upon failure, return NULL with errno set. */ -char *canonicalize_filename_mode (const char *, canonicalize_mode_t); +char *canonicalize_filename_mode (const char *, canonicalize_mode_t) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; #ifdef __cplusplus } -- 2.39.5