summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2023-08-03 18:34:06 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2023-08-03 20:55:20 +0100
commitcf3fecb9e873df38a9245775a3887e73a8716083 (patch)
tree12aaeab205f2401efa8c95e5d90636bc939f57db /src
parent8c5ab0901f665bfd16bb0a0e85cef8b26e4e7818 (diff)
Fix free of $value after ${run...}
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index ae1657549..e0c571ade 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -5624,6 +5624,8 @@ while (*s)
FILE * f;
const uschar * arg, ** argv;
BOOL late_expand = TRUE;
+ uschar * save_value = lookup_value;
+ int yesno;
if (expand_forbid & RDO_RUN)
{
@@ -5747,20 +5749,24 @@ while (*s)
expand_string_message = string_sprintf("command killed by signal %d",
-runrc);
+ lookup_value = save_value;
goto EXPAND_FAILED;
}
}
/* Process the yes/no strings; $value may be useful in both cases */
- switch(process_yesno(
+ yesno = process_yesno(
flags, /* were previously skipping */
runrc == 0, /* success/failure indicator */
lookup_value, /* value to reset for string2 */
&s, /* input pointer */
&yield, /* output pointer */
US"run", /* condition type */
- &resetok))
+ &resetok);
+ lookup_value = save_value;
+
+ switch(yesno)
{
case 1: goto EXPAND_FAILED; /* when all is well, the */
case 2: goto EXPAND_FAILED_CURLY; /* returned value is 0 */