diff: Don't try to call unlink(NULL) on certain error paths.

Actual bug found by GCC analyzer.
This commit is contained in:
Richard W.M. Jones
2021-02-22 10:08:47 +00:00
parent 001c1dc09f
commit acefa23758

View File

@@ -773,8 +773,8 @@ diff (struct file *file1, guestfs_h *g1, struct file *file2, guestfs_h *g2)
printf ("@@ %s @@\n", _("End of diff"));
out:
unlink (tmpda);
unlink (tmpdb);
if (tmpda) unlink (tmpda);
if (tmpdb) unlink (tmpdb);
rmdir (tmpd);
}