From fd2e8d9d2bc3dcce3707823c0ec0643f066c0b3f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Apr 2026 19:06:04 -0400 Subject: Fix incorrect size used by realloc --- src/lib/delivery/delivery_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/delivery/delivery_test.c b/src/lib/delivery/delivery_test.c index 3ba9d56..ce6d73d 100644 --- a/src/lib/delivery/delivery_test.c +++ b/src/lib/delivery/delivery_test.c @@ -21,10 +21,10 @@ int tests_add(struct Tests *tests, struct Test *x) { #ifdef DEBUG const size_t old_alloc = tests->num_alloc; #endif - struct Test **tmp = realloc(tests->test, tests->num_alloc++ * sizeof(*tests->test)); + struct Test **tmp = realloc(tests->test, tests->num_alloc++ * sizeof(**tests->test)); SYSDEBUG("Increasing size of test array: %zu -> %zu", old_alloc, tests->num_alloc); if (!tmp) { - SYSDEBUG("Failed to allocate %zu bytes for test array", tests->num_alloc * sizeof(*tests->test)); + SYSDEBUG("Failed to allocate %zu bytes for test array", tests->num_alloc * sizeof(**tests->test)); return -1; } tests->test = tmp; -- cgit