target/riscv: fix close fileio and free temp when conditions are met
- When `fileio` is valid, close it; - When `temp` exists, free its memory; - This ensures proper resource management. Change-Id: I66be66e3945415f2e970ea47c077942be5977541 Signed-off-by: Huaqi Fang <578567190@qq.com>
This commit is contained in:
parent
2c8bf769e0
commit
30bbf4dabc
|
@ -691,9 +691,9 @@ fail:
|
|||
LOG_ERROR("Unexpected error happened during dumping etrace!");
|
||||
retval = ERROR_OK;
|
||||
ok:
|
||||
if (!fileio)
|
||||
if (fileio)
|
||||
fileio_close(fileio);
|
||||
if (!temp)
|
||||
if (temp)
|
||||
free(temp);
|
||||
|
||||
return retval;
|
||||
|
|
Loading…
Reference in New Issue