[PATCH 1/3] util: Remove unnecessary check in virFileRewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since g_strdup_printf will abort, we know @newfile won't be NULL.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/util/virfile.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index cb6cfc0fe7..fca7ff9d35 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -543,8 +543,7 @@ virFileRewrite(const char *path,
 
  cleanup:
     VIR_FORCE_CLOSE(fd);
-    if (newfile)
-        unlink(newfile);
+    unlink(newfile);
     return ret;
 }
 
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux