From: Jeremy Harris Date: Sat, 16 Jan 2016 19:14:58 +0000 (+0000) Subject: Expansions: avoid releasing memory used for $value in ${run } X-Git-Tag: exim-4_87_RC3~10 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/1a08dbc45c0f4d1d813c9dfcf3ea1f72d0a4c3ff?hp=d20ede8da27eb2a848f3ed0d1bc71b70ace2a2f2 Expansions: avoid releasing memory used for $value in ${run } --- diff --git a/src/src/expand.c b/src/src/expand.c index 85d8c6a27..c78040ea7 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -3187,7 +3187,7 @@ if (*s == '}') } else { - if (yes && lookup_value != NULL) + if (yes && lookup_value) *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, lookup_value, Ustrlen(lookup_value)); lookup_value = save_lookup; @@ -4929,8 +4929,10 @@ while (*s != 0) /* Read the pipe to get the command's output into $value (which is kept in lookup_value). Read during execution, so that if the output exceeds - the OS pipe buffer limit, we don't block forever. */ + the OS pipe buffer limit, we don't block forever. Remember to not release + memory just allocated for $value. */ + resetok = FALSE; f = fdopen(fd_out, "rb"); sigalrm_seen = FALSE; alarm(60);