From ee26e51015d3b59e382622348c241e7261ee38e4 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 25 Sep 2024 11:16:23 +0200 Subject: [PATCH] Use abort instead to exit in calloc_or_fail * abort generates a core dump --- common/utils/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/utils.h b/common/utils/utils.h index 082d1dd635..841cb2af9c 100644 --- a/common/utils/utils.h +++ b/common/utils/utils.h @@ -75,7 +75,7 @@ static inline void *calloc_or_fail(size_t nmemb, size_t size) if (ptr == NULL) { fprintf(stderr, "Failed to calloc() %zu elements of %zu bytes: out of memory", nmemb, size); - exit(EXIT_FAILURE); + abort(); } return ptr;