PVS/V595: pointer utilized before checking NULL

This commit is contained in:
Justin M. Keyes
2019-04-12 00:41:20 +02:00
parent 49ca20aaf3
commit b4ca56d96d

View File

@@ -1718,6 +1718,7 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags)
*/ */
buf = NULL; buf = NULL;
if ((flags & BLN_CURBUF) && curbuf_reusable()) { if ((flags & BLN_CURBUF) && curbuf_reusable()) {
assert(curbuf != NULL);
buf = curbuf; buf = curbuf;
/* It's like this buffer is deleted. Watch out for autocommands that /* It's like this buffer is deleted. Watch out for autocommands that
* change curbuf! If that happens, allocate a new buffer anyway. */ * change curbuf! If that happens, allocate a new buffer anyway. */