diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-08 19:06:04 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-08 19:06:04 -0400 |
| commit | fd2e8d9d2bc3dcce3707823c0ec0643f066c0b3f (patch) | |
| tree | 117d58d3bf1fa306ab4bc5acd7ef15cafb2d251a | |
| parent | 269e2c5eb511ef74fe293c428202ddeb38ada0db (diff) | |
| download | stasis-fd2e8d9d2bc3dcce3707823c0ec0643f066c0b3f.tar.gz | |
Fix incorrect size used by realloc
| -rw-r--r-- | src/lib/delivery/delivery_test.c | 4 |
1 files 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; |
