ncplane_at_yx_cell(): plug memory leak on success path

This commit is contained in:
nick black 2020-04-18 08:15:24 -04:00
parent 1c7796a2b0
commit dba42f9eef
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -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 uint64_t channels = c->channels; // need to preserve wide flag
int r = cell_load(n, c, egc); int r = cell_load(n, c, egc);
c->channels = channels; c->channels = channels;
if(r < 0){
free(egc); free(egc);
}
return r; return r;
} }