Skip to content

Commit 5bd2b31

Browse files
authored
Merge pull request FRRouting#20094 from soumyar-roy/soumya/id_pool_null_check
lib: NULL-check idalloc pools
2 parents 974510d + e196047 commit 5bd2b31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/id_alloc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ void idalloc_drain_pool(struct id_alloc *alloc, struct id_alloc_pool **pool_ptr)
368368
while (*pool_ptr) {
369369
current = *pool_ptr;
370370
next = current->next;
371-
idalloc_free(alloc, current->id);
371+
372+
if (alloc)
373+
idalloc_free(alloc, current->id);
374+
372375
XFREE(MTYPE_IDALLOC_POOL, current);
373376
*pool_ptr = next;
374377
}

0 commit comments

Comments
 (0)