lib: 'tmpfile' is never NULL (found by Coverity).

This commit is contained in:
Richard W.M. Jones
2012-12-08 15:50:05 +00:00
parent 359c8f8902
commit 96e59eee66

View File

@@ -329,7 +329,7 @@ write_or_append (guestfs_h *g, const char *path,
const char *content, size_t size,
int append)
{
char *tmpfile = NULL;
char *tmpfile;
int fd = -1;
int64_t filesize;
@@ -381,10 +381,8 @@ write_or_append (guestfs_h *g, const char *path,
err:
if (fd >= 0)
close (fd);
if (tmpfile) {
unlink (tmpfile);
free (tmpfile);
}
unlink (tmpfile);
free (tmpfile);
return -1;
}