From: Arran Cudbard-Bell Date: Mon, 11 Oct 2021 19:37:57 +0000 (-0500) Subject: Don't call iterator if next is NULL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f67c1e198f4305941dffdccfd72e999b41ecc343;p=thirdparty%2Ffreeradius-server.git Don't call iterator if next is NULL --- diff --git a/src/lib/util/dcursor.h b/src/lib/util/dcursor.h index 729abe71969..4d251766528 100644 --- a/src/lib/util/dcursor.h +++ b/src/lib/util/dcursor.h @@ -127,6 +127,7 @@ static inline void *dcursor_next(fr_dcursor_t *cursor, void *current) * Pre-advance current */ next = fr_dlist_next(cursor->dlist, current); + if (!next) return NULL; /* * The iterator can just return what it was passed for curr