diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-25 14:18:37 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-25 14:18:37 -0400 |
| commit | 0d4b95442be1dcb72855a2384744d0e13cc4ee7d (patch) | |
| tree | f072753922e28ba324047da27c2a720fd32ebc1e /src/cli | |
| parent | 1b86d8fee99fef44671da649cec83356b404328f (diff) | |
| download | stasis-0d4b95442be1dcb72855a2384744d0e13cc4ee7d.tar.gz | |
usage: fail on allocation error
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/stasis_indexer/args.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cli/stasis_indexer/args.c b/src/cli/stasis_indexer/args.c index 8c9d3fe..e77c0b7 100644 --- a/src/cli/stasis_indexer/args.c +++ b/src/cli/stasis_indexer/args.c @@ -22,6 +22,10 @@ const char *long_options_help[] = { void usage(char *name) { const int maxopts = sizeof(long_options) / sizeof(long_options[0]); char *opts = calloc(maxopts + 1, sizeof(char)); + if (!opts) { + SYSERROR("%s", "Unable to allocate memory for options array"); + exit(1); + } for (int i = 0; i < maxopts; i++) { opts[i] = (char) long_options[i].val; } |
