From: Alan T. DeKok Date: Wed, 20 May 2020 15:29:49 +0000 (-0400) Subject: also check that node 0 isn't already in the heap X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4000880c83e6cddd65ead4d2b4d2b5a2aae3de2;p=thirdparty%2Ffreeradius-server.git also check that node 0 isn't already in the heap --- diff --git a/src/lib/util/heap.c b/src/lib/util/heap.c index 3676a5b698a..a93ecb2ff57 100644 --- a/src/lib/util/heap.c +++ b/src/lib/util/heap.c @@ -124,7 +124,7 @@ int fr_heap_insert(fr_heap_t *hp, void *data) * function */ child = *((int32_t *)(((uint8_t *)data) + hp->offset)); - if (child > 0) { + if ((child > 0) || ((child == 0) && (data == hp->p[0]))) { fr_strerror_printf("Node is already in the heap"); return -1; }