From 3d96b5249ba121ddb4d21b72ebb6726764105339 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 12 Aug 2020 01:48:14 -0400 Subject: [PATCH] ncdirect_dump_plane(): plug memory leak of egc --- src/lib/direct.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/direct.cpp b/src/lib/direct.cpp index 356850915..9865feeb8 100644 --- a/src/lib/direct.cpp +++ b/src/lib/direct.cpp @@ -287,8 +287,10 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){ ncdirect_bg(n, channels_bg(channels)); //fprintf(stderr, "%03d/%03d [%s] (%03dx%03d)\n", y, x, egc, dimy, dimx); if(fprintf(n->ttyfp, "%s", strlen(egc) == 0 ? " " : egc) < 0){ + free(egc); return -1; } + free(egc); } if(dimx < totx){ ncdirect_bg_default(n);