diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-29 14:15:24 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-30 02:23:13 -0400 |
| commit | 6d262fab389df302c9a311fb44022d538d88b80e (patch) | |
| tree | 92612aa828b38af9d15911c3289488a2ca0912cd | |
| parent | 87ba4d2c3e3d00f48ff3435a59ac78648ab76ecf (diff) | |
| download | stasis-6d262fab389df302c9a311fb44022d538d88b80e.tar.gz | |
Add matching popd() call on error
| -rw-r--r-- | src/lib/delivery/delivery_build.c | 6 | ||||
| -rw-r--r-- | src/lib/delivery/delivery_test.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/delivery/delivery_build.c b/src/lib/delivery/delivery_build.c index 9ef5d92..7ea5b29 100644 --- a/src/lib/delivery/delivery_build.c +++ b/src/lib/delivery/delivery_build.c @@ -466,6 +466,7 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { if (mkdirs(outdir, 0755)) { SYSERROR("failed to create output directory: %s", outdir); guard_strlist_free(&result); + popd(); return NULL; } if (use_builder_manylinux) { @@ -474,18 +475,21 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { ctx->tests->test[i]->version); guard_strlist_free(&result); guard_free(cmd); + popd(); return NULL; } } else if (use_builder_build || use_builder_cibuildwheel) { if (use_builder_build) { if (asprintf(&cmd, "-m build -w -o %s", outdir) < 0) { SYSERROR("Unable to allocate memory for build command"); + popd(); return NULL; } } else if (use_builder_cibuildwheel) { if (asprintf(&cmd, "-m cibuildwheel --output-dir %s --only cp%s-manylinux_%s", outdir, ctx->meta.python_compact, ctx->system.arch) < 0) { SYSERROR("Unable to allocate memory for cibuildwheel command"); + popd(); return NULL; } } @@ -495,10 +499,12 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { ctx->tests->test[i]->version); guard_strlist_free(&result); guard_free(cmd); + popd(); return NULL; } } else { SYSERROR("unknown wheel builder backend: %s", globals.wheel_builder); + popd(); return NULL; } diff --git a/src/lib/delivery/delivery_test.c b/src/lib/delivery/delivery_test.c index 79f882a..4ea3b3d 100644 --- a/src/lib/delivery/delivery_test.c +++ b/src/lib/delivery/delivery_test.c @@ -217,6 +217,7 @@ void delivery_tests_run(struct Delivery *ctx) { if (test->disable) { msg(STASIS_MSG_L2, "Script execution disabled by configuration\n", test->name); guard_free(cmd); + popd(); continue; } |
