From eb902759d86b6e4cfc5df7da93d798a97a4f0fbd Mon Sep 17 00:00:00 2001 From: ashamedbit Date: Tue, 27 Feb 2024 23:51:52 -0500 Subject: [PATCH] Fix leak in canvas.c --- libr/cons/canvas.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libr/cons/canvas.c b/libr/cons/canvas.c index 55d119a91c..095b16542f 100644 --- a/libr/cons/canvas.c +++ b/libr/cons/canvas.c @@ -483,15 +483,7 @@ R_API int r_cons_canvas_resize(RConsCanvas *c, int w, int h) { c->blen[i] = w; c->bsize[i] = w + 1; if (!newline) { - size_t j; - for (j = 0; j <= i; j++) { - free (c->b[i]); - } - ht_up_free (c->attrs); - free (c->blen); - free (c->bsize); - free (c->b); - free (c); + r_cons_canvas_free (c); return false; } c->b[i] = newline;