terminal.c: Fix memory leak #2982

dict_set_value() returns the replaced Object in a dictionary. Here
the Object is unused and needs to be freed.
This commit is contained in:
oni-link 2015-07-08 11:58:12 +02:00 committed by Justin M. Keyes
parent e0b550b5f0
commit 9a72f6b955

View File

@ -572,9 +572,10 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *data)
case VTERM_PROP_TITLE: {
Error err;
dict_set_value(term->buf->b_vars,
cstr_as_string("term_title"),
STRING_OBJ(cstr_as_string(val->string)), &err);
api_free_object(dict_set_value(term->buf->b_vars,
cstr_as_string("term_title"),
STRING_OBJ(cstr_as_string(val->string)),
&err));
break;
}