array: use die_if_null() from common/mem.c

This commit is contained in:
John Lindgren 2025-09-03 00:00:01 -04:00 committed by Hiroaki Yamamoto
parent a29bf5366f
commit e9f17dc4a2
3 changed files with 10 additions and 7 deletions

View file

@ -4,6 +4,12 @@
#include <stdlib.h>
/*
* If ptr is NULL, prints an error (based on errno) and exits.
* Suitable for checking the return value of malloc() etc.
*/
void die_if_null(void *ptr);
/*
* As defined in busybox, weston, etc.
* Allocates zero-filled memory; calls exit() on error.