Check for presence of prevl before using

This commit is contained in:
David Crosby
2015-07-26 00:12:39 -06:00
committed by Tatsuya Kinoshita
parent dac68e4d90
commit 66036b0db6

View File

@@ -761,8 +761,10 @@ readBufferCache(Buffer *buf)
} }
#endif #endif
} }
buf->lastLine = prevl; if (prevl) {
buf->lastLine->next = NULL; buf->lastLine = prevl;
buf->lastLine->next = NULL;
}
fclose(cache); fclose(cache);
unlink(buf->savecache); unlink(buf->savecache);
buf->savecache = NULL; buf->savecache = NULL;