virGetUserCacheDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx> --- 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); -- 2.24.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list