From ea192301461c22067e8632fc1cdfc680003eb858 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 12 Apr 2024 08:52:31 -0400 Subject: Protect INIFILEs from clobbering --- src/deliverable.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/deliverable.c b/src/deliverable.c index 510baa3..906517d 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -200,14 +200,20 @@ void delivery_free(struct Delivery *ctx) { guard_strlist_free(&ctx->deploy.jfrog[i].files); } - ini_free(&ctx->_omc_ini_fp.delivery); + if (ctx->_omc_ini_fp.delivery) { + ini_free(&ctx->_omc_ini_fp.delivery); + } guard_free(ctx->_omc_ini_fp.delivery_path); + if (ctx->_omc_ini_fp.cfg) { // optional extras ini_free(&ctx->_omc_ini_fp.cfg); - guard_free(ctx->_omc_ini_fp.cfg_path); } - ini_free(&ctx->_omc_ini_fp.mission); + guard_free(ctx->_omc_ini_fp.cfg_path); + + if (ctx->_omc_ini_fp.mission) { + ini_free(&ctx->_omc_ini_fp.mission); + } guard_free(ctx->_omc_ini_fp.mission_path); } -- cgit