summaryrefslogtreecommitdiffstats
path: root/arguments.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2023-11-14 18:01:10 +0000
committerThomas Adam <thomas@xteddy.org>2023-11-14 18:01:10 +0000
commit151875d144e5c2b76502a2283cc38b04945b958f (patch)
tree0d66fbf78e9c2bed0827e9d32805e3e2ecee6f03 /arguments.c
parent381c00a74ea1eb136a97c86da9a7713190b10a62 (diff)
parent88fd1f00b8e2c2455df9d15bd0b0e0d0ef5044ac (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'arguments.c')
-rw-r--r--arguments.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arguments.c b/arguments.c
index f3152ddf..8b2aa1ad 100644
--- a/arguments.c
+++ b/arguments.c
@@ -761,6 +761,7 @@ args_make_commands_prepare(struct cmd *self, struct cmdq_item *item, u_int idx,
struct args_value *value;
struct args_command_state *state;
const char *cmd;
+ const char *file;
state = xcalloc(1, sizeof *state);
@@ -787,7 +788,8 @@ args_make_commands_prepare(struct cmd *self, struct cmdq_item *item, u_int idx,
if (wait)
state->pi.item = item;
- cmd_get_source(self, &state->pi.file, &state->pi.line);
+ cmd_get_source(self, &file, &state->pi.line);
+ state->pi.file = xstrdup(file);
state->pi.c = tc;
if (state->pi.c != NULL)
state->pi.c->references++;
@@ -842,6 +844,7 @@ args_make_commands_free(struct args_command_state *state)
cmd_list_free(state->cmdlist);
if (state->pi.c != NULL)
server_client_unref(state->pi.c);
+ free((void *)state->pi.file);
free(state->cmd);
free(state);
}