diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-05-10 17:04:41 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-05-11 15:55:54 -0400 |
| commit | 398c71a07c84312d7438974d178a0358d3713e2b (patch) | |
| tree | 76a3a2cbdcfd4c5420fe6b825ede3193bad5b4ef /src/cli/stasis_indexer | |
| parent | 5ec6f09c2abcc866b4ba34a995d5f61e7851df48 (diff) | |
| download | stasis-398c71a07c84312d7438974d178a0358d3713e2b.tar.gz | |
Error check
Diffstat (limited to 'src/cli/stasis_indexer')
| -rw-r--r-- | src/cli/stasis_indexer/junitxml_report.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cli/stasis_indexer/junitxml_report.c b/src/cli/stasis_indexer/junitxml_report.c index 891fe8a..909bf1d 100644 --- a/src/cli/stasis_indexer/junitxml_report.c +++ b/src/cli/stasis_indexer/junitxml_report.c @@ -30,11 +30,17 @@ static int write_report_output(struct Delivery *ctx, FILE *destfp, const char *x } char *bname_tmp = strdup(xmlfilename); + if (!bname_tmp) { + SYSERROR("%s", "unable to allocate bytes for temporary basename"); + return -1; + } + char *bname = strdup(path_basename(bname_tmp)); if (!bname) { SYSERROR("%s", "unable to allocate bytes for basename"); return -1; } + if (endswith(bname, ".xml")) { bname[strlen(bname) - 4] = 0; } |
