From: Arran Cudbard-Bell Date: Tue, 17 Aug 2021 19:10:46 +0000 (-0500) Subject: Sprinkle more unlikelys X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81b7575d43aa456b2843944d5f8bb9de124eb655;p=thirdparty%2Ffreeradius-server.git Sprinkle more unlikelys --- diff --git a/src/lib/util/heap.c b/src/lib/util/heap.c index 6430a67bd89..39adf7c5c0b 100644 --- a/src/lib/util/heap.c +++ b/src/lib/util/heap.c @@ -69,7 +69,7 @@ fr_heap_t *_fr_heap_alloc(TALLOC_CTX *ctx, fr_heap_cmp_t cmp, char const *type, hp->size = 2048; hp->p = talloc_array(hp, void *, hp->size); - if (!hp->p) { + if (unlikely(!hp->p)) { talloc_free(hp); return NULL; } @@ -162,7 +162,7 @@ int fr_heap_insert(fr_heap_t *hp, void *data) } n = talloc_realloc(hp, hp->p, void *, n_size); - if (!n) { + if (unlikely(!n)) { fr_strerror_printf("Failed expanding heap to %u elements (%u bytes)", n_size, (n_size * (unsigned int)sizeof(void *))); return -1;