tools: ublimage: Fix memory leak in parse_cfg_file()

Dynamic memory, referenced by 'line', is allocated at ublimage.c:159
by calling function 'getline' and lost at ublimage.c:184.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
This commit is contained in:
Maks Mishin
2025-02-02 20:05:42 +03:00
committed by Tom Rini
parent 25c03648e9
commit 4545880c3c

View File

@@ -178,6 +178,7 @@ static uint32_t parse_cfg_file(struct ubl_header *ublhdr, char *name)
lineno, fld, &dcd_len);
}
}
free(line);
fclose(fd);
return dcd_len;