summaryrefslogtreecommitdiffstats
path: root/cmd-load-buffer.c
diff options
context:
space:
mode:
authornicm <nicm>2018-01-15 15:27:03 +0000
committernicm <nicm>2018-01-15 15:27:03 +0000
commit481703d6698467e459d5b3ff3cd4322bd0385798 (patch)
treeec7f24dda76717f62cb5311dac2ed9704e4126fd /cmd-load-buffer.c
parentb0c1cefeda9d11910dd4a174e82c9f57ff8bc495 (diff)
Some unused code, GitHub issue 1219.
Diffstat (limited to 'cmd-load-buffer.c')
-rw-r--r--cmd-load-buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c
index a3cabdc0..74f97d1d 100644
--- a/cmd-load-buffer.c
+++ b/cmd-load-buffer.c
@@ -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;