From 66036b0db62e8b9bdeb575109becc31fa3eff88a Mon Sep 17 00:00:00 2001 From: David Crosby Date: Sun, 26 Jul 2015 00:12:39 -0600 Subject: Check for presence of prevl before using --- buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index f67dd26..3b2352a 100644 --- a/buffer.c +++ b/buffer.c @@ -761,8 +761,10 @@ readBufferCache(Buffer *buf) } #endif } - buf->lastLine = prevl; - buf->lastLine->next = NULL; + if (prevl) { + buf->lastLine = prevl; + buf->lastLine->next = NULL; + } fclose(cache); unlink(buf->savecache); buf->savecache = NULL; -- cgit v1.2.3