diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-22 12:02:34 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-22 12:02:34 -0400 |
| commit | a8e1217917fc18651f3fdfe8f7a122f1e1b2c238 (patch) | |
| tree | dc315c0b5e79c941a8077c18bd44c3d560600453 | |
| parent | bd27953a9c54c158bafeb90ffad0d2a0bda366e1 (diff) | |
| download | stasis-a8e1217917fc18651f3fdfe8f7a122f1e1b2c238.tar.gz | |
stasis_main: exit on memory error
| -rw-r--r-- | src/cli/stasis/stasis_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 697791a..b2d17b4 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -30,14 +30,19 @@ static void setup_sysconfdir() { static void setup_python_version_override(struct Delivery *ctx, const char *version) { // Override Python version from command-line, if any - if (strlen(version)) { + if (version && strlen(version)) { guard_free(ctx->meta.python); ctx->meta.python = strdup(version); if (!ctx->meta.python) { SYSERROR("%s", "Unable to allocate bytes for python version override"); + exit(1); } guard_free(ctx->meta.python_compact); ctx->meta.python_compact = to_short_version(ctx->meta.python); + if (!ctx->meta.python_compact) { + SYSERROR("%s", "Unable to allocate bytes for python compact version override"); + exit(1); + } } } |
