From aa88882c41fbdbf16a4836ac9bdf62453965c598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 19 Dec 2019 09:50:34 +0100 Subject: [PATCH] vbox: Don't check the output of virGetUserCacheDirectory() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit virGetUserCacheDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio Reviewed-by: Ján Tomko --- src/vbox/vbox_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 586937fa19..4493fe8582 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -7374,9 +7374,8 @@ vboxDomainScreenshot(virDomainPtr dom, if (privileged) { cacheDir = g_strdup_printf("%s/cache/libvirt", LOCALSTATEDIR); - } else if (!(cacheDir = virGetUserCacheDirectory())) { - VBOX_RELEASE(machine); - return NULL; + } else { + cacheDir = virGetUserCacheDirectory(); } tmp = g_strdup_printf("%s/vbox.screendump.XXXXXX", cacheDir); -- GitLab