In 5120ba28a2021 I've tried to fix couple of problems with this API (all kinds of resource leaks, bad conditions to some checks and so on). However, my clumsy fix introduced unlink even to a success path so after all callers were left with a non-existent path to screenshot file. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/libvirt-php.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libvirt-php.c b/src/libvirt-php.c index 7916d07..693f911 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -4790,7 +4790,6 @@ PHP_FUNCTION(libvirt_domain_get_screenshot_api) VIRT_ADD_ASSOC_STRING(return_value, "file", fileNew); VIRT_ADD_ASSOC_STRING(return_value, "mime", "image/png"); } else { - unlink(file); close(fd); fd = -1; VIRT_ADD_ASSOC_STRING(return_value, "file", file); -- 2.8.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list