diff --git a/src/demo/highcon.c b/src/demo/highcon.c index e56766748..284dbba58 100644 --- a/src/demo/highcon.c +++ b/src/demo/highcon.c @@ -82,9 +82,11 @@ int highcontrast_demo(struct notcurses* nc){ cell_load_simple(n, &c, motto[out % strlen(motto)]); cell_set_bg(&c, scrcolors[out % totcells]); if(ncplane_putc_yx(n, (out + dimx) / dimx, out % dimx, &c) < 0){ + free(scrcolors); goto err; } } + free(scrcolors); // each iteration, "draw the background in" one cell from the top left and // bottom right. int offset = 0; @@ -110,6 +112,5 @@ int highcontrast_demo(struct notcurses* nc){ err: cell_release(n, &c); - free(scrcolors); return ret; } diff --git a/src/lib/reel.c b/src/lib/reel.c index 0cef157ed..be9eda118 100644 --- a/src/lib/reel.c +++ b/src/lib/reel.c @@ -536,11 +536,11 @@ int ncreel_redraw(ncreel* nr){ if(nr->last_traveled_direction >= 0){ otherend = draw_previous_tablets(nr, otherend); otherend = draw_following_tablets(nr, otherend); - otherend = draw_previous_tablets(nr, otherend); + draw_previous_tablets(nr, otherend); }else{ otherend = draw_following_tablets(nr, otherend); otherend = draw_previous_tablets(nr, otherend); - otherend = draw_following_tablets(nr, otherend); + draw_following_tablets(nr, otherend); } //fprintf(stderr, "DONE ARRANGING\n"); return 0; diff --git a/src/lib/render.c b/src/lib/render.c index 149ac1509..b06a4c496 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -35,15 +35,12 @@ int notcurses_resize(notcurses* n, int* restrict rows, int* restrict cols){ const size_t size = sizeof(*n->lastframe) * (n->lfdimy * n->lfdimx); cell* fb = realloc(n->lastframe, size); if(fb == NULL){ - abort(); // FIXME return -1; } n->lastframe = fb; // FIXME more memset()tery than we need, both wasting work and wrecking // damage detection for the upcoming render memset(n->lastframe, 0, size); - n->lastframe = fb; - memset(fb, 0, size); egcpool_dump(&n->pool); } if(*rows == oldrows && *cols == oldcols){ @@ -445,6 +442,7 @@ int ncplane_mergedown(ncplane* restrict src, ncplane* restrict dst){ postpaint(tmpfb, rendfb, dimy, dimx, rvec, &dst->pool); free(dst->fb); dst->fb = rendfb; + free(tmpfb); free(rvec); return 0; } diff --git a/src/poc/direct.c b/src/poc/direct.c index 76ddba47a..934f24ae1 100644 --- a/src/poc/direct.c +++ b/src/poc/direct.c @@ -53,7 +53,6 @@ int main(void){ y -= up; int newy; if(ncdirect_cursor_yx(n, &newy, NULL)){ - ret = -1; return EXIT_FAILURE; } if(newy != y){