diff options
Diffstat (limited to 'src/lib/delivery')
-rw-r--r-- | src/lib/delivery/delivery.c | 4 | ||||
-rw-r--r-- | src/lib/delivery/delivery_init.c | 8 | ||||
-rw-r--r-- | src/lib/delivery/delivery_populate.c | 14 |
3 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/delivery/delivery.c b/src/lib/delivery/delivery.c index aa3e51a..41be64c 100644 --- a/src/lib/delivery/delivery.c +++ b/src/lib/delivery/delivery.c @@ -40,6 +40,7 @@ void delivery_free(struct Delivery *ctx) { guard_free(ctx->info.build_name); guard_free(ctx->info.build_number); guard_free(ctx->info.release_name); + guard_free(ctx->info.time_info); guard_free(ctx->conda.installer_baseurl); guard_free(ctx->conda.installer_name); guard_free(ctx->conda.installer_version); @@ -50,8 +51,10 @@ void delivery_free(struct Delivery *ctx) { guard_free(ctx->conda.tool_build_version); guard_strlist_free(&ctx->conda.conda_packages); guard_strlist_free(&ctx->conda.conda_packages_defer); + guard_strlist_free(&ctx->conda.conda_packages_purge); guard_strlist_free(&ctx->conda.pip_packages); guard_strlist_free(&ctx->conda.pip_packages_defer); + guard_strlist_free(&ctx->conda.pip_packages_purge); guard_strlist_free(&ctx->conda.wheels_packages); for (size_t i = 0; i < sizeof(ctx->tests) / sizeof(ctx->tests[0]); i++) { @@ -62,6 +65,7 @@ void delivery_free(struct Delivery *ctx) { guard_free(ctx->tests[i].repository_info_tag); guard_strlist_free(&ctx->tests[i].repository_remove_tags); guard_free(ctx->tests[i].script); + guard_free(ctx->tests[i].script_setup); guard_free(ctx->tests[i].build_recipe); // test-specific runtime variables guard_runtime_free(ctx->tests[i].runtime.environ); 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; diff --git a/src/lib/delivery/delivery_populate.c b/src/lib/delivery/delivery_populate.c index e9aea89..63df9fd 100644 --- a/src/lib/delivery/delivery_populate.c +++ b/src/lib/delivery/delivery_populate.c @@ -30,11 +30,21 @@ int populate_info(struct Delivery *ctx) { if (!ctx->info.time_str_epoch) { // Record timestamp used for release time(&ctx->info.time_now); - ctx->info.time_info = localtime(&ctx->info.time_now); + if (!ctx->info.time_info) { + ctx->info.time_info = malloc(sizeof(*ctx->info.time_info)); + if (!ctx->info.time_info) { + msg(STASIS_MSG_ERROR, "%s: Unable to allocate memory for time_info\n", strerror(errno)); + return -1; + } + if (!localtime_r(&ctx->info.time_now, ctx->info.time_info)) { + msg(STASIS_MSG_ERROR, "%s: localtime_r failed\n", strerror(errno)); + return -1; + } + } ctx->info.time_str_epoch = calloc(STASIS_TIME_STR_MAX, sizeof(*ctx->info.time_str_epoch)); if (!ctx->info.time_str_epoch) { - msg(STASIS_MSG_ERROR, "Unable to allocate memory for Unix epoch string\n"); + msg(STASIS_MSG_ERROR, "%s: Unable to allocate memory for Unix epoch string\n", strerror(errno)); return -1; } snprintf(ctx->info.time_str_epoch, STASIS_TIME_STR_MAX - 1, "%li", ctx->info.time_now); |