* windows-spawn: Improve GCC 11 allocation-deallocation checking
@ 2021-08-07 21:06 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-08-07 21:06 UTC (permalink / raw)
To: bug-gnulib
2021-08-07 Bruno Haible <bruno@clisp.org>
windows-spawn: Improve GCC 11 allocation-deallocation checking.
* lib/windows-spawn.h: Include <stdlib.h>.
(compose_command, compose_envblock): Declare that deallocation must
happen through 'free'.
diff --git a/lib/windows-spawn.h b/lib/windows-spawn.h
index 78c7736..5ba4664 100644
--- a/lib/windows-spawn.h
+++ b/lib/windows-spawn.h
@@ -20,6 +20,7 @@
#include <stdbool.h>
#include <stdint.h>
+#include <stdlib.h>
/* Get declarations of the native Windows API functions. */
#define WIN32_LEAN_AND_MEAN
@@ -72,14 +73,16 @@ extern const char ** prepare_spawn (const char * const *argv,
prepare_spawn.
Returns a freshly allocated string. In case of memory allocation failure,
NULL is returned, with errno set. */
-extern char * compose_command (const char * const *argv);
+extern char * compose_command (const char * const *argv)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
/* Composes the block of memory that contains the environment variables.
ENVP must contain an environment (a NULL-terminated array of string of the
form VARIABLE=VALUE).
Returns a freshly allocated block of memory. In case of memory allocation
failure, NULL is returned, with errno set. */
-extern char * compose_envblock (const char * const *envp);
+extern char * compose_envblock (const char * const *envp)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
/* This struct keeps track of which handles to pass to a subprocess, and with
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-07 21:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 21:06 windows-spawn: Improve GCC 11 allocation-deallocation checking Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).