Do not double free expanded path in source-file, also remove some

unnecessary assignments.
pull/2851/head
nicm 2021-08-22 13:48:29 +00:00
parent c0048d6d20
commit 72d905f32c
4 changed files with 4 additions and 6 deletions

View File

@ -121,8 +121,6 @@ cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item,
if (sr != NULL)
break;
}
if (line == lines)
ranges = &tc->status.entries[0].ranges;
if (sr != NULL) {
format_add(ft, "popup_window_status_line_x", "%u",

View File

@ -180,12 +180,12 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
free(pattern);
continue;
}
free(expanded);
free(pattern);
for (j = 0; j < g.gl_pathc; j++)
cmd_source_file_add(cdata, g.gl_pathv[j]);
}
free(expanded);
cdata->after = item;
cdata->retval = retval;

4
file.c
View File

@ -558,7 +558,7 @@ file_write_open(struct client_files *files, struct tmuxpeer *peer,
log_debug("open write file %d %s", msg->stream, path);
find.stream = msg->stream;
if ((cf = RB_FIND(client_files, files, &find)) != NULL) {
if (RB_FIND(client_files, files, &find) != NULL) {
error = EBADF;
goto reply;
}
@ -717,7 +717,7 @@ file_read_open(struct client_files *files, struct tmuxpeer *peer,
log_debug("open read file %d %s", msg->stream, path);
find.stream = msg->stream;
if ((cf = RB_FIND(client_files, files, &find)) != NULL) {
if (RB_FIND(client_files, files, &find) != NULL) {
error = EBADF;
goto reply;
}

View File

@ -280,7 +280,7 @@ server_client_open(struct client *c, char **cause)
static void
server_client_attached_lost(struct client *c)
{
struct session *s = c->session;
struct session *s;
struct window *w;
struct client *loop;
struct client *found;