From: Roy Marples Date: Fri, 31 Mar 2017 11:04:09 +0000 (+0100) Subject: Call posix_spawnattr_destroy after calling posix_spawn so that X-Git-Tag: v7.0.0-beta1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4069fb6f14e2904a86c7ebdbeee87e0b50342230;p=thirdparty%2Fdhcpcd.git Call posix_spawnattr_destroy after calling posix_spawn so that any memory allocated by posix_spawnattr_init is reclaimed. Fixes a memory leak on FreeBSD and OpenBSD. --- diff --git a/src/script.c b/src/script.c index dcac0d4b..d5fd43e6 100644 --- a/src/script.c +++ b/src/script.c @@ -110,6 +110,7 @@ exec_script(const struct dhcpcd_ctx *ctx, char *const *argv, char *const *env) #endif errno = 0; r = posix_spawn(&pid, argv[0], NULL, &attr, argv, env); + posix_spawnattr_destroy(&attr); if (r) { errno = r; return -1;