luigi: don't free garbage on error path

This commit is contained in:
nick black 2020-05-07 01:24:19 -04:00
parent 3384fad429
commit fa865d1971
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -171,7 +171,7 @@ int luigi_demo(struct notcurses* nc){
for(i = 0 ; i < 3 ; ++i){
lns[i] = ncplane_new(nc, height, 16, yoff, 0, NULL);
if(lns[i] == NULL){
while(--i){
while(i--){
ncplane_destroy(lns[i]);
}
return -1;