]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't call iterator if next is NULL
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 11 Oct 2021 19:37:57 +0000 (14:37 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 11 Oct 2021 19:37:57 +0000 (14:37 -0500)
src/lib/util/dcursor.h

index 729abe719699459f2f4c509cd3db4372850b740c..4d2517665289b3325447c42dd2b06fe9dc1e159a 100644 (file)
@@ -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