mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -2245,7 +2245,8 @@ ebiptablesWriteToTempFile(const char *string) {
|
||||
|
||||
err_exit:
|
||||
VIR_FREE(header);
|
||||
close(fd);
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
unlink(filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user