fix(options): properly free string options (#19510)

This commit is contained in:
zeertzjq
2022-07-27 07:26:32 +08:00
committed by GitHub
parent 890d4023cd
commit 79872f3770
4 changed files with 18 additions and 8 deletions

View File

@@ -451,7 +451,7 @@ void terminal_enter(void)
if (save_curwin == curwin->handle) { // Else: window was closed.
curwin->w_p_cul = save_w_p_cul;
if (save_w_p_culopt) {
xfree(curwin->w_p_culopt);
free_string_option(curwin->w_p_culopt);
curwin->w_p_culopt = save_w_p_culopt;
}
curwin->w_p_culopt_flags = save_w_p_culopt_flags;
@@ -459,7 +459,7 @@ void terminal_enter(void)
curwin->w_p_so = save_w_p_so;
curwin->w_p_siso = save_w_p_siso;
} else if (save_w_p_culopt) {
xfree(save_w_p_culopt);
free_string_option(save_w_p_culopt);
}
// draw the unfocused cursor