aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-12 08:52:31 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-12 08:52:31 -0400
commitea192301461c22067e8632fc1cdfc680003eb858 (patch)
treedf226411f2c51e655feb146f7807ca560949e181 /src
parente71c2897880025b3a67b29ec141aeec4d3065ded (diff)
downloadstasis-ea192301461c22067e8632fc1cdfc680003eb858.tar.gz
Protect INIFILEs from clobbering
Diffstat (limited to 'src')
-rw-r--r--src/deliverable.c12
1 files changed, 9 insertions, 3 deletions
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);
}