aboutsummaryrefslogtreecommitdiff
path: root/src/lib/delivery
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-29 12:43:44 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-11 15:50:47 -0400
commitc985cdf4019db2957e3073fec11c9b7a9fe3487c (patch)
tree0a1ca576adeb385e3af47b53ba9fd5d12912d63d /src/lib/delivery
parentd9ce0e78895e5dfa1e57aca76bb93b4b76dc6e74 (diff)
downloadstasis-c985cdf4019db2957e3073fec11c9b7a9fe3487c.tar.gz
delivery_duplicate: free context on error
Diffstat (limited to 'src/lib/delivery')
-rw-r--r--src/lib/delivery/delivery.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/delivery/delivery.c b/src/lib/delivery/delivery.c
index cbc5898..557a0ed 100644
--- a/src/lib/delivery/delivery.c
+++ b/src/lib/delivery/delivery.c
@@ -56,12 +56,16 @@ struct Delivery *delivery_duplicate(struct Delivery *ctx) {
result->rules._handle = malloc(sizeof(*result->rules._handle));
if (!result->rules._handle) {
SYSERROR("unable to allocate space for INIFILE handle");
+ SYSERROR("%s", "unable to allocate space for INIFILE handle");
+ delivery_free(ctx);
return NULL;
}
result->rules._handle->section = malloc(ctx->rules._handle->section_count * sizeof(**ctx->rules._handle->section));
if (!result->rules._handle->section) {
guard_free(result->rules._handle);
SYSERROR("unable to allocate space for INIFILE section");
+ SYSERROR("%s", "unable to allocate space for INIFILE section");
+ delivery_free(ctx);
return NULL;
}
memcpy(result->rules._handle, &ctx->rules._handle, sizeof(*ctx->rules._handle));
@@ -102,6 +106,8 @@ struct Delivery *delivery_duplicate(struct Delivery *ctx) {
result->system.platform = malloc(DELIVERY_PLATFORM_MAX * sizeof(*result->system.platform));
if (!result->system.platform) {
SYSERROR("unable to allocate space for system platform array");
+ SYSERROR("%s", "unable to allocate space for system platform array");
+ delivery_free(ctx);
return NULL;
}
for (size_t i = 0; i < DELIVERY_PLATFORM_MAX; i++) {