summaryrefslogtreecommitdiffstats
path: root/cmd-source-file.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-23 16:06:46 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-23 16:06:46 +0100
commit95a374d7d20dde938563a9f92c8ffc1e25bd4050 (patch)
tree596cfdc4aa9c9d7a0f04cd1c8b541e86ede90eef /cmd-source-file.c
parent1dec1ca146882572e261f2f2f55d9060c06a0212 (diff)
parent210e71edf36198e3f22525e7f548a71a5681d25c (diff)
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-source-file.c')
-rw-r--r--cmd-source-file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd-source-file.c b/cmd-source-file.c
index 71f69d59..255d443e 100644
--- a/cmd-source-file.c
+++ b/cmd-source-file.c
@@ -65,6 +65,7 @@ static void
cmd_source_file_complete(struct client *c, struct cmd_source_file_data *cdata)
{
struct cmdq_item *new_item;
+ u_int i;
if (cfg_finished) {
if (cdata->retval == CMD_RETURN_ERROR &&
@@ -75,6 +76,8 @@ cmd_source_file_complete(struct client *c, struct cmd_source_file_data *cdata)
cmdq_insert_after(cdata->after, new_item);
}
+ for (i = 0; i < cdata->nfiles; i++)
+ free(cdata->files[i]);
free(cdata->files);
free(cdata);
}
@@ -176,6 +179,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
cmdq_error(item, "%s: %s", path, error);
retval = CMD_RETURN_ERROR;
}
+ globfree(&g);
free(pattern);
continue;
}
@@ -183,6 +187,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
for (j = 0; j < g.gl_pathc; j++)
cmd_source_file_add(cdata, g.gl_pathv[j]);
+ globfree(&g);
}
free(expanded);