summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-01-16 19:14:58 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2016-01-16 19:14:58 +0000
commit1a08dbc45c0f4d1d813c9dfcf3ea1f72d0a4c3ff (patch)
tree2ca2ddf7e12d6446a20234a165fe4d47ae7294b5 /src
parentd20ede8da27eb2a848f3ed0d1bc71b70ace2a2f2 (diff)
Expansions: avoid releasing memory used for $value in ${run }
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c6
1 files changed, 4 insertions, 2 deletions
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);