Use abort instead to exit in calloc_or_fail

* abort generates a core dump
This commit is contained in:
Guido Casati
2024-10-02 11:36:43 +02:00
parent 13757cfd28
commit ee26e51015
+1 -1
View File
@@ -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;