mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
free tmp after unlinking it
We create a temporary file to save memory, and we will remove it after reading memory to buffer. But we free the variable that contains the temporary filename before we remove it. So we should free tmp after unlinking it.
This commit is contained in:
parent
51434d3bef
commit
e206946da7
@ -5065,9 +5065,9 @@ endjob:
|
||||
vm = NULL;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(tmp);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
unlink (tmp);
|
||||
VIR_FREE(tmp);
|
||||
if (vm)
|
||||
virDomainObjUnlock(vm);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user