Skip to content

Commit

Permalink
Fix a memleak in tsm_screen_unref and one in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
aheck authored and Aetf committed Dec 22, 2023
1 parent b383592 commit 5c720b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tsm/tsm-screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,12 @@ void tsm_screen_unref(struct tsm_screen *con)
line_free(con->main_lines[i]);
line_free(con->alt_lines[i]);
}

free(con->main_lines);
free(con->alt_lines);
free(con->tab_ruler);
tsm_symbol_table_unref(con->sym_table);
tsm_screen_clear_sb(con);
free(con);
}

Expand Down
6 changes: 6 additions & 0 deletions test/test_vte.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ START_TEST(test_vte_backspace_key)
ck_assert(r);
r = tsm_vte_handle_keyboard(vte, XKB_KEY_BackSpace, 0177, 0, 0177);
ck_assert(r);

tsm_vte_unref(vte);
vte = NULL;

tsm_screen_unref(screen);
screen = NULL;
}
END_TEST

Expand Down

0 comments on commit 5c720b9

Please sign in to comment.