Check for presence of prevl before using

This commit is contained in:
David Crosby
2015-08-11 21:59:28 +09:00
committed by Tatsuya Kinoshita
parent dac68e4d90
commit 66036b0db6
+4 -2
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;