* lib/cygpath.h: Include stdlib.h for free declaration.
(cygpath_w): Mark function with _GL_ATTRIBUTE_MALLOC and
_GL_ATTRIBUTE_DEALLOC_FREE since it will always return a malloc'ed
pointer or NULL.
---
 ChangeLog     | 8 ++++++++
 lib/cygpath.h | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 008e8a2500..75f242528a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-02-28  Collin Funk  <[email protected]>
+
+       cygpath: Use _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.
+       * lib/cygpath.h: Include stdlib.h for free declaration.
+       (cygpath_w): Mark function with _GL_ATTRIBUTE_MALLOC and
+       _GL_ATTRIBUTE_DEALLOC_FREE since it will always return a malloc'ed
+       pointer or NULL.
+
 2026-02-28  Bruno Haible  <[email protected]>
 
        file-remote: Use streq.
diff --git a/lib/cygpath.h b/lib/cygpath.h
index 64607d2aef..989e944b51 100644
--- a/lib/cygpath.h
+++ b/lib/cygpath.h
@@ -19,6 +19,8 @@
 #ifndef _CYGPATH_H
 #define _CYGPATH_H
 
+#include <stdlib.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -28,7 +30,8 @@ extern "C" {
    Returns a freshly allocated file name.
    On the other platforms, it returns a freshly allocated copy of the
    argument file name.  */
-extern char *cygpath_w (const char *filename);
+extern char *cygpath_w (const char *filename)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 #ifdef __cplusplus
 }
-- 
2.53.0


Reply via email to