]> git.ipfire.org Git - thirdparty/libvirt.git/commit
screenshot: don't unlink bogus file
authorEric Blake <eblake@redhat.com>
Tue, 2 Aug 2011 16:58:21 +0000 (10:58 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 2 Aug 2011 19:10:35 +0000 (13:10 -0600)
commit440d6b6a0bd4c971bfc045c17ac2c8128d5ec82e
treed653f6bd6995b61e7283f3086ad51a51a1c0b73e
parent69154397944aaffe79069769245dd75f38a59bfc
screenshot: don't unlink bogus file

The previous qemu patch could end up calling unlink(tmp) before
tmp was the name of a valid file (unlinking a fileXXXXXX template
instead), or calling unlink(tmp) twice on success (once here,
and once at the end of the stream).  Meanwhile, vbox also suffered
from the same leaked tmp file bug.

* src/qemu/qemu_driver.c (qemuDomainScreenshot): Don't unlink on
success, or on invalid name.
* src/vbox/vbox_tmpl.c (vboxDomainScreenshot): Don't leak temp file.
src/qemu/qemu_driver.c
src/vbox/vbox_tmpl.c