In listGetIterator function comment, common usage code like this:
iter = listGetIterator(list,<direction>);
while ((node = listNext(iter)) != NULL) {
doSomethingWith(listNodeValue(node));
}
But listGetIterator may return NULL, and listNext doesn't check the parameter "iter", so it's possible that we end up using a NULL pointer.
listNode *listNext(listIter *iter)
{
listNode *current = iter->next;
...
}
Comment From: sundb
Unless OOM, listGetIterator will not return NULL, OOM is already handled in zmalloc.