diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-08 19:55:21 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-08 19:55:21 -0400 |
| commit | 0268551a0c9b1e6cba422efa88f36cb8e663bd82 (patch) | |
| tree | 20cd64bf2bf4c013d3202b6f41e0bb1af7db9620 | |
| parent | d25ffbedb80fc4e02945c518dcae91d3a5ef6db6 (diff) | |
| download | stasis-0268551a0c9b1e6cba422efa88f36cb8e663bd82.tar.gz | |
Check memory allocations on init
| -rw-r--r-- | src/lib/delivery/delivery_test.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/delivery/delivery_test.c b/src/lib/delivery/delivery_test.c index ce6d73d..b879689 100644 --- a/src/lib/delivery/delivery_test.c +++ b/src/lib/delivery/delivery_test.c @@ -37,7 +37,14 @@ int tests_add(struct Tests *tests, struct Test *x) { struct Test *test_init() { struct Test *result = calloc(1, sizeof(*result)); + if (!result) { + return NULL; + } + result->runtime = calloc(1, sizeof(*result->runtime)); + if (!result->runtime) { + return NULL; + } return result; } |
