aboutsummaryrefslogtreecommitdiff
path: root/src/cli
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-05-10 17:04:41 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-11 15:55:54 -0400
commit398c71a07c84312d7438974d178a0358d3713e2b (patch)
tree76a3a2cbdcfd4c5420fe6b825ede3193bad5b4ef /src/cli
parent5ec6f09c2abcc866b4ba34a995d5f61e7851df48 (diff)
downloadstasis-398c71a07c84312d7438974d178a0358d3713e2b.tar.gz
Error check
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/stasis_indexer/junitxml_report.c6
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;
}