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:
Wen Congyang 2011-03-31 11:28:21 +08:00
parent 51434d3bef
commit e206946da7

View File

@ -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;