diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-01-11 23:44:04 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-01-11 23:44:04 +0100 |
| commit | 964d816726b8c765277b043894d534e9b1e0d60c (patch) | |
| tree | 0a7769532ebd41007a914889a0e96d171ad1ca55 /src/ref.c | |
| parent | a9d37006eae7227d498c7c658360ee1e43b3e054 (diff) | |
| download | tmus-964d816726b8c765277b043894d534e9b1e0d60c.tar.gz tmus-964d816726b8c765277b043894d534e9b1e0d60c.zip | |
Check aprintf allocation internally and add astrdup for less OOM_CHECK
Diffstat (limited to 'src/ref.c')
| -rw-r--r-- | src/ref.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,13 +1,15 @@ #include "ref.h" #include "util.h" +#include <err.h> + struct ref * ref_alloc(void *data) { struct ref *ref; ref = malloc(sizeof(struct ref)); - if (!ref) return NULL; + if (!ref) err(1, "malloc"); ref->link = LINK_EMPTY; ref->data = data; |
