From 3abde17b9ebf6f1b1dabdef3c6690d7b9ed3f6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 28 Mar 2021 21:01:22 +0200 Subject: [PATCH] term: free vt.osc8.uri when destroying a terminal Free vt.osc8.uri in term_destroy(), in the off chance, that the client application emitted an un-terminated OSC-8 URI. --- terminal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terminal.c b/terminal.c index 1984562f..47c0e1ff 100644 --- a/terminal.c +++ b/terminal.c @@ -1430,6 +1430,7 @@ term_destroy(struct terminal *term) mtx_unlock(&term->render.workers.lock); free(term->vt.osc.data); + free(term->vt.osc8.uri); grid_free(&term->normal); grid_free(&term->alt); @@ -1679,6 +1680,7 @@ term_reset(struct terminal *term, bool hard) free(term->vt.osc.data); memset(&term->vt, 0, sizeof(term->vt)); term->vt.state = 0; /* GROUND */ + term->vt.osc8.begin = (struct coord){-1, -1}; free(term->vt.osc8.uri); term->vt.osc8.uri = NULL;