aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cli/stasis_indexer/junitxml_report.c1
-rw-r--r--src/lib/core/wheel.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/cli/stasis_indexer/junitxml_report.c b/src/cli/stasis_indexer/junitxml_report.c
index 4eae7f7..c6cf4b0 100644
--- a/src/cli/stasis_indexer/junitxml_report.c
+++ b/src/cli/stasis_indexer/junitxml_report.c
@@ -38,6 +38,7 @@ static int write_report_output(struct Delivery *ctx, FILE *destfp, const char *x
char *short_name_pattern = NULL;
if (asprintf(&short_name_pattern, "-%s", ctx->info.release_name) < 0 || !short_name_pattern) {
SYSERROR("%s", "unable to allocate bytes for short name pattern");
+ guard_free(bname);
return -1;
}
diff --git a/src/lib/core/wheel.c b/src/lib/core/wheel.c
index c8c75ca..9f3b3c8 100644
--- a/src/lib/core/wheel.c
+++ b/src/lib/core/wheel.c
@@ -77,6 +77,7 @@ static ssize_t wheel_parse_wheel(struct Wheel * pkg, const char * data) {
char *value = strdup(lstrip(pair[1]));
if (!value) {
SYSERROR("%s", "could not allocate memory for wheel value");
+ guard_free(key);
return -1;
}
@@ -95,6 +96,8 @@ static ssize_t wheel_parse_wheel(struct Wheel * pkg, const char * data) {
pkg->wheel_version = strdup(value);
if (!pkg->wheel_version) {
// memory error
+ guard_free(key);
+ guard_free(value);
wheel_package_free(&pkg);
return -1;
}
@@ -104,6 +107,8 @@ static ssize_t wheel_parse_wheel(struct Wheel * pkg, const char * data) {
pkg->generator = strdup(value);
if (!pkg->generator) {
// memory error
+ guard_free(key);
+ guard_free(value);
wheel_package_free(&pkg);
return -1;
}
@@ -113,6 +118,8 @@ static ssize_t wheel_parse_wheel(struct Wheel * pkg, const char * data) {
pkg->root_is_pure_lib = strdup(value);
if (!pkg->root_is_pure_lib) {
// memory error
+ guard_free(key);
+ guard_free(value);
wheel_package_free(&pkg);
return -1;
}
@@ -122,6 +129,8 @@ static ssize_t wheel_parse_wheel(struct Wheel * pkg, const char * data) {
if (!pkg->tag) {
pkg->tag = strlist_init();
if (!pkg->tag) {
+ guard_free(key);
+ guard_free(value);
wheel_package_free(&pkg);
return -1;
}