Skip to content

Commit e4c598e

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 d14aa67 commit e4c598e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

qdl.c

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

258260
ptr += filesize;

0 commit comments

Comments
 (0)