diff options
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r-- | src/nvim/terminal.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 19b9bdc19f..43e4ea87e3 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -633,13 +633,14 @@ static int term_movecursor(VTermPos new, VTermPos old, int visible, static void buf_set_term_title(buf_T *buf, char *title) FUNC_ATTR_NONNULL_ALL { - Error err; + Error err = ERROR_INIT; dict_set_var(buf->b_vars, STATIC_CSTR_AS_STRING("term_title"), STRING_OBJ(cstr_as_string(title)), false, false, &err); + xfree(err.msg); } static int term_settermprop(VTermProp prop, VTermValue *val, void *data) @@ -1220,12 +1221,15 @@ static bool is_focused(Terminal *term) #define GET_CONFIG_VALUE(k, o) \ do { \ - Error err; \ + Error err = ERROR_INIT; \ /* Only called from terminal_open where curbuf->terminal is the */ \ /* context */ \ o = dict_get_value(curbuf->b_vars, cstr_as_string(k), &err); \ + xfree(err.msg); \ if (o.type == kObjectTypeNil) { \ - o = dict_get_value(&globvardict, cstr_as_string(k), &err); \ + Error err2 = ERROR_INIT; \ + o = dict_get_value(&globvardict, cstr_as_string(k), &err2); \ + xfree(err2.msg); \ } \ } while (0) |