From 4b948ef52add8c3a93aef6fd38a3928ccf4e36d7 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 2 Oct 2024 14:54:45 -0400 Subject: Free resources on error in delivery_index_wheel_artifacts --- src/delivery_postprocess.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/delivery_postprocess.c b/src/delivery_postprocess.c index 43a1105..1a902e3 100644 --- a/src/delivery_postprocess.c +++ b/src/delivery_postprocess.c @@ -208,6 +208,7 @@ int delivery_index_wheel_artifacts(struct Delivery *ctx) { sprintf(top_index, "%s/index.html", ctx->storage.wheel_artifact_dir); top_fp = fopen(top_index, "w+"); if (!top_fp) { + closedir(dp); return -2; } @@ -223,6 +224,7 @@ int delivery_index_wheel_artifacts(struct Delivery *ctx) { sprintf(bottom_index, "%s/%s/index.html", ctx->storage.wheel_artifact_dir, rec->d_name); bottom_fp = fopen(bottom_index, "w+"); if (!bottom_fp) { + closedir(dp); return -3; } @@ -237,6 +239,7 @@ int delivery_index_wheel_artifacts(struct Delivery *ctx) { sprintf(dpath, "%s/%s", ctx->storage.wheel_artifact_dir, rec->d_name); struct StrList *packages = listdir(dpath); if (!packages) { + closedir(dp); fclose(top_fp); fclose(bottom_fp); return -4; -- cgit