aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-25 10:17:56 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-25 10:17:56 -0400
commit1b86d8fee99fef44671da649cec83356b404328f (patch)
treeb31ea4817c1d58575139c30b904681d801bc4759 /src
parentcb90837b058ea1680ada46752294b992fbf542a4 (diff)
downloadstasis-1b86d8fee99fef44671da649cec83356b404328f.tar.gz
wheel_parse_wheel: handle key allocation error
Diffstat (limited to 'src')
-rw-r--r--src/lib/core/wheel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/core/wheel.c b/src/lib/core/wheel.c
index 0bc4209..9e656ce 100644
--- a/src/lib/core/wheel.c
+++ b/src/lib/core/wheel.c
@@ -69,9 +69,14 @@ static ssize_t wheel_parse_wheel(struct Wheel * pkg, const char * data) {
char **pair = split(line, ":", 1);
if (pair) {
char *key = strdup(strip(pair[0]));
- char *value = strdup(lstrip(pair[1]));
+ if (!key) {
+ SYSERROR("%s", "could not allocate memory for pair wheel key");
+ return -1;
+ }
- if (!key || !value) {
+ char *value = strdup(lstrip(pair[1]));
+ if (value) {
+ SYSERROR("%s", "could not allocate memory for wheel value");
return -1;
}