--- V/lib/InitAWin.c 2016-12-01 03:12:04.232788000 -0800 +++ V/lib/InitAWin.c 2016-12-02 03:05:52.713495000 -0800 @@ -69,6 +69,13 @@ w->csPool1 = (ColorSegment *) malloc(w->CSSize1 * sizeof(ColorSegment)); memset(w->csPool1, 0, w->CSSize1 * sizeof(ColorSegment)); + // Initialize csPool2 so program doesn't crash later, + // when trying to free it. + { + w->CSSize2 = 0; + w->csPool2 = (ColorSegment *) NULL; + } + w->scanLine = (ScanLine *) malloc((w->height + 1) * sizeof(ScanLine)); w->lastScanLine = (ScanLine *) malloc((w->height + 1) * sizeof(ScanLine)); w->otherLastScanLine = NULL;