aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/core/wheel.c9
1 files changed, 9 insertions, 0 deletions
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;
}