Skip to content

Commit

Permalink
Fix memleak in __rotate_panel_cmds()
Browse files Browse the repository at this point in the history
  • Loading branch information
pelijah committed Apr 27, 2024
1 parent 7815038 commit f37708a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions librz/core/tui/panels.c
Original file line number Diff line number Diff line change
Expand Up @@ -5994,10 +5994,10 @@ void __rotate_panel_cmds(RzCore *core, const char **cmds, const int cmdslen, con
} else {
p->model->rotate++;
}
char tmp[64], *between;
char tmp[64];
int i = p->model->rotate % cmdslen;
snprintf(tmp, sizeof(tmp), "%s%s", prefix, cmds[i]);
between = rz_str_between(p->model->cmd, prefix, " ");
char *between = rz_str_between(p->model->cmd, prefix, " ");
if (between) {
char replace[64];
snprintf(replace, sizeof(replace), "%s%s", prefix, between);
Expand All @@ -6009,6 +6009,7 @@ void __rotate_panel_cmds(RzCore *core, const char **cmds, const int cmdslen, con
}
__set_cmd_str_cache(core, p, NULL);
p->view->refresh = true;
free(between);
}

void __rotate_entropy_v_cb(void *user, bool rev) {
Expand Down

0 comments on commit f37708a

Please sign in to comment.