xload: fix use after free
The variable partname is used in the error path for debugging. We have to free it after this use. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
efeeea3501
commit
f53a2c1bfa
|
@ -119,13 +119,14 @@ static void *omap_xload_boot_mmc(void)
|
|||
|
||||
ret = mount(partname, "fat", "/", NULL);
|
||||
|
||||
free(partname);
|
||||
|
||||
if (ret) {
|
||||
printf("Unable to mount %s (%d)\n", partname, ret);
|
||||
free(partname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
free(partname);
|
||||
|
||||
buf = read_file("/barebox.bin", &len);
|
||||
if (!buf) {
|
||||
printf("could not read barebox.bin from sd card\n");
|
||||
|
|
Loading…
Reference in New Issue