aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cfg.c2
-rw-r--r--cmd-find.c2
-rw-r--r--cmd-load-buffer.c6
3 files changed, 3 insertions, 7 deletions
diff --git a/cfg.c b/cfg.c
index 86901e6a..a448c4b1 100644
--- a/cfg.c
+++ b/cfg.c
@@ -287,8 +287,6 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item, int quiet)
}
free(buf);
- if (cmdlist == NULL)
- continue;
new_item = cmdq_get_command(cmdlist, NULL, NULL, 0);
if (item != NULL)
cmdq_insert_after(item, new_item);
diff --git a/cmd-find.c b/cmd-find.c
index 358161a9..3c583d79 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -588,8 +588,6 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane)
/* Try special characters. */
if (strcmp(pane, "!") == 0) {
- if (fs->w->last == NULL)
- return (-1);
fs->wp = fs->w->last;
if (fs->wp == NULL)
return (-1);
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;