forked from auracaster/openocd
TARGET: fix segfault in handle_dump_image_command()
The struct fileio is used after fileio_close(). Move fileio_close() after last usage. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Øyvind Harboe
parent
e3773e3e3d
commit
2ee47b22c6
+3
-3
@@ -2643,9 +2643,6 @@ COMMAND_HANDLER(handle_dump_image_command)
|
|||||||
address += this_run_size;
|
address += this_run_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((retvaltemp = fileio_close(&fileio)) != ERROR_OK)
|
|
||||||
return retvaltemp;
|
|
||||||
|
|
||||||
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
|
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
|
||||||
{
|
{
|
||||||
int filesize;
|
int filesize;
|
||||||
@@ -2657,6 +2654,9 @@ COMMAND_HANDLER(handle_dump_image_command)
|
|||||||
duration_elapsed(&bench), duration_kbps(&bench, filesize));
|
duration_elapsed(&bench), duration_kbps(&bench, filesize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((retvaltemp = fileio_close(&fileio)) != ERROR_OK)
|
||||||
|
return retvaltemp;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user