From dba42f9eef53071b6c410750667ef11d931d92de Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 18 Apr 2020 08:15:24 -0400 Subject: [PATCH] ncplane_at_yx_cell(): plug memory leak on success path --- include/notcurses/notcurses.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index 89249078e..b079ab68d 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -1155,9 +1155,7 @@ ncplane_at_yx_cell(struct ncplane* n, int y, int x, cell* c){ uint64_t channels = c->channels; // need to preserve wide flag int r = cell_load(n, c, egc); c->channels = channels; - if(r < 0){ - free(egc); - } + free(egc); return r; }