diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 09:36:14 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 09:36:14 -0500 |
commit | 78ded5bc427eba89e425064e38b63dd65a4c679b (patch) | |
tree | 169af1a01f2e1356f6cfb909cae1edba8acd996c /src/lib/delivery/delivery_init.c | |
parent | 672cdfa07cf83fec396836cbe1ba1415e5764ebf (diff) | |
download | stasis-78ded5bc427eba89e425064e38b63dd65a4c679b.tar.gz |
Replace localtime with localtime_r and allocate a new buffer for each Delivery context
Diffstat (limited to 'src/lib/delivery/delivery_init.c')
-rw-r--r-- | src/lib/delivery/delivery_init.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/delivery/delivery_init.c b/src/lib/delivery/delivery_init.c index 2fced03..fe60075 100644 --- a/src/lib/delivery/delivery_init.c +++ b/src/lib/delivery/delivery_init.c @@ -296,10 +296,12 @@ int bootstrap_build_info(struct Delivery *ctx) { ctx->info.build_name = strdup(local.info.build_name); ctx->info.build_number = strdup(local.info.build_number); ctx->info.release_name = strdup(local.info.release_name); - ctx->info.time_info = malloc(sizeof(*ctx->info.time_info)); if (!ctx->info.time_info) { - SYSERROR("Unable to allocate %zu bytes for tm struct: %s", sizeof(*local.info.time_info), strerror(errno)); - return -1; + ctx->info.time_info = malloc(sizeof(*ctx->info.time_info)); + if (!ctx->info.time_info) { + SYSERROR("Unable to allocate %zu bytes for tm struct: %s", sizeof(*local.info.time_info), strerror(errno)); + return -1; + } } memcpy(ctx->info.time_info, local.info.time_info, sizeof(*local.info.time_info)); ctx->info.time_now = local.info.time_now; |