Fix CID 1385633 (Dereference before null check)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-04-26 14:34:49 +02:00
parent af72ad77e8
commit e2135de022

View File

@ -210,11 +210,13 @@ ELIST_LINK *ELIST_ITERATOR::forward() {
cycle_pt = next;
current = next;
}
#ifndef NDEBUG
if (!current)
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr);
#endif
next = current->next;
#ifndef NDEBUG
if (!current)
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr);
if (!next)
NULL_NEXT.error ("ELIST_ITERATOR::forward", ABORT,
"This is: %p Current is: %p", this, current);