From 1b86d8fee99fef44671da649cec83356b404328f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 25 Apr 2026 10:17:56 -0400 Subject: wheel_parse_wheel: handle key allocation error --- src/lib/core/wheel.c | 9 +++++++-- 1 file 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; } -- cgit