ebiptablesWriteToTempFile: don't close a negative file descriptor

* src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesWriteToTempFile):
Skip the close if "fd" is negative.
This commit is contained in:
Jim Meyering 2010-05-18 10:11:23 +02:00
parent 31e29fe524
commit 0058184c4e

View File

@ -2245,7 +2245,8 @@ ebiptablesWriteToTempFile(const char *string) {
err_exit:
VIR_FREE(header);
close(fd);
if (fd >= 0)
close(fd);
unlink(filename);
return NULL;
}