=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-source-file.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- src/usr.bin/tmux/cmd-source-file.c 2021/08/22 13:48:29 1.52 +++ src/usr.bin/tmux/cmd-source-file.c 2021/08/23 11:04:21 1.53 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-source-file.c,v 1.52 2021/08/22 13:48:29 nicm Exp $ */ +/* $OpenBSD: cmd-source-file.c,v 1.53 2021/08/23 11:04:21 nicm Exp $ */ /* * Copyright (c) 2008 Tiago Cunha @@ -66,6 +66,7 @@ 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 && @@ -76,6 +77,8 @@ cmdq_insert_after(cdata->after, new_item); } + for (i = 0; i < cdata->nfiles; i++) + free(cdata->files[i]); free(cdata->files); free(cdata); } @@ -177,6 +180,7 @@ cmdq_error(item, "%s: %s", path, error); retval = CMD_RETURN_ERROR; } + globfree(&g); free(pattern); continue; } @@ -184,6 +188,7 @@ for (j = 0; j < g.gl_pathc; j++) cmd_source_file_add(cdata, g.gl_pathv[j]); + globfree(&g); } free(expanded);