diff options
Diffstat (limited to 'usr.bin/tmux/cmd-load-buffer.c')
-rw-r--r-- | usr.bin/tmux/cmd-load-buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c index eb388c71e27..9e83de8f2a6 100644 --- a/usr.bin/tmux/cmd-load-buffer.c +++ b/usr.bin/tmux/cmd-load-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-load-buffer.c,v 1.50 2017/04/22 06:13:30 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.51 2018/01/15 15:27:03 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -59,7 +59,8 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item) struct client *c = item->client; FILE *f; const char *path, *bufname; - char *pdata, *new_pdata, *cause, *file; + char *pdata = NULL, *new_pdata, *cause; + char *file; size_t psize; int ch, error; @@ -89,8 +90,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item) f = fopen(file, "rb"); if (f == NULL) { cmdq_error(item, "%s: %s", file, strerror(errno)); - free(file); - return (CMD_RETURN_ERROR); + goto error; } pdata = NULL; |