diff options
author | Himbeer <himbeer@disroot.org> | 2024-09-17 10:17:16 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-09-17 18:01:03 +0200 |
commit | f03688fa74b9bb3f13a106e61a3d7f2e9e85c8f8 (patch) | |
tree | aec747d5cdd7cfa86d1b58705f70a5b8c0e888ad /include/util.h | |
parent | 2f595cce4a25c04052199043e8cc0d0bba7e1ceb (diff) |
Add must_malloc helper function
malloc(3) can fail, most likely in out-of-memory situations. This helper
terminates the program in such cases instead of permitting assignments
of null pointers.
Diffstat (limited to 'include/util.h')
-rw-r--r-- | include/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h index 2a1e72a..12829ef 100644 --- a/include/util.h +++ b/include/util.h @@ -6,4 +6,6 @@ enum exit_status { EXIT_ABNORMAL = 255, }; +void *must_malloc(size_t size); + #endif |