termiointernals: remove leak

This commit is contained in:
Boris Faure 2019-07-08 23:02:41 +02:00
parent 54340c464d
commit dff54aeca2
1 changed files with 4 additions and 2 deletions

View File

@ -349,6 +349,7 @@ termio_internal_get_selection(Termio *sd, size_t *lenp)
{
int i;
struct ty_sb sb = {.buf = NULL, .len = 0, .alloc = 0};
char *tmp;
for (i = start_y; i <= end_y; i++)
{
@ -365,8 +366,9 @@ termio_internal_get_selection(Termio *sd, size_t *lenp)
ty_sb_free(&isb);
}
len = sb.len;
s = ty_sb_steal_buf(&sb);
s = eina_stringshare_add_length(s, len);
tmp = ty_sb_steal_buf(&sb);
s = eina_stringshare_add_length(tmp, len);
free(tmp);
ty_sb_free(&sb);
}
else