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:
parent
e3773e3e3d
commit
2ee47b22c6
|
@ -2643,9 +2643,6 @@ COMMAND_HANDLER(handle_dump_image_command)
|
|||
address += this_run_size;
|
||||
}
|
||||
|
||||
if ((retvaltemp = fileio_close(&fileio)) != ERROR_OK)
|
||||
return retvaltemp;
|
||||
|
||||
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
|
||||
{
|
||||
int filesize;
|
||||
|
@ -2657,6 +2654,9 @@ COMMAND_HANDLER(handle_dump_image_command)
|
|||
duration_elapsed(&bench), duration_kbps(&bench, filesize));
|
||||
}
|
||||
|
||||
if ((retvaltemp = fileio_close(&fileio)) != ERROR_OK)
|
||||
return retvaltemp;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue