diff options
Diffstat (limited to 'executor/common_linux.h')
| -rw-r--r-- | executor/common_linux.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index c1368f292..9fbccbd7a 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -242,6 +242,7 @@ static void find_vf_interface(void) } address = address->ifa_next; } + close(fd); freeifaddrs(addresses); if (!vf_intf.ppid) { memset(&vf_intf, 0, sizeof(struct vf_intf)); @@ -2084,6 +2085,8 @@ static long syz_usbip_server_init(volatile long a0) int available_port_num = __atomic_fetch_add(&port_alloc[usb3], 1, __ATOMIC_RELAXED); if (available_port_num > VHCI_HC_PORTS) { debug("syz_usbip_server_init : no more available port for : %d\n", available_port_num); + close(client_fd); + close(server_fd); return -1; } @@ -2208,8 +2211,10 @@ static char* read_btf_vmlinux() ssize_t ret = read(fd, buf + bytes_read, VMLINUX_MAX_SUPPORT_SIZE - bytes_read); - if (ret < 0 || bytes_read + ret == VMLINUX_MAX_SUPPORT_SIZE) + if (ret < 0 || bytes_read + ret == VMLINUX_MAX_SUPPORT_SIZE) { + close(fd); return NULL; + } if (ret == 0) break; @@ -2217,6 +2222,7 @@ static char* read_btf_vmlinux() bytes_read += ret; } + close(fd); is_read = true; return buf; } |
