Skip to content

Commit bbd0881

Browse files
qdl: report error when malloc fails in decode_programmer_archive
Every other error path in this function calls ux_err() before jumping to the err label. Add the missing message for the malloc failure case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fba5f41 commit bbd0881

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/qdl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ static int decode_programmer_archive(struct sahara_image *blob, struct sahara_im
252252
images[id].name = strdup(tok);
253253
images[id].len = filesize;
254254
images[id].ptr = malloc(filesize);
255-
if (!images[id].ptr)
255+
if (!images[id].ptr) {
256+
ux_err("failed to allocate memory for programmer archive entry\n");
256257
goto err;
258+
}
257259
memcpy(images[id].ptr, ptr, filesize);
258260

259261
ptr += filesize;

0 commit comments

Comments
 (0)