[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 41/53] gdbstub: Prevent fd leakage
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 41/53] gdbstub: Prevent fd leakage |
Date: |
Thu, 31 May 2018 19:15:54 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
Since 2f652224f7, we now check if socket_set_nodelay() errored,
but forgot to close the socket before reporting an error.
Fixes: Coverity CID 1391290 (RESOURCE_LEAK)
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
gdbstub.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdbstub.c b/gdbstub.c
index 6081e719c5..d6ab95006c 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1842,6 +1842,7 @@ static bool gdb_accept(void)
/* set short latency */
if (socket_set_nodelay(fd)) {
perror("setsockopt");
+ close(fd);
return false;
}
--
2.17.0
- [Qemu-devel] [PULL 31/53] mux: fix ctrl-a b again, (continued)
- [Qemu-devel] [PULL 31/53] mux: fix ctrl-a b again, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 32/53] memfd: Avoid Coverity warning about integer overflow, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 33/53] exec.c: Initialize sa_flags passed to sigaction(), Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 29/53] memory: delete struct AddressSpaceOps, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 36/53] qemu-options: Mark the non-functional -clock option as deprecated, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 35/53] WHPX: fix some compiler warnings, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 37/53] tcg: remove softfloat from --disable-tcg builds, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 34/53] WHPX: dynamically load WHP libraries, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 39/53] ipmi: Use proper struct reference for KCS vmstate, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 43/53] scripts/update-linux-headers: Handle __aligned_u64, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 41/53] gdbstub: Prevent fd leakage,
Paolo Bonzini <=
- [Qemu-devel] [PULL 45/53] target/i386/kvm.c: Handle renaming of KVM_HINTS_DEDICATED, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 40/53] docs/interop: add "firmware.json", Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 44/53] scripts/update-linux-headers: Handle kernel license no longer being one file, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 47/53] target/i386/kvm.c: Remove compatibility shim for KVM_HINTS_REALTIME, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 42/53] virtio-gpu-3d: Define VIRTIO_GPU_CAPSET_VIRGL2 elsewhere, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 48/53] hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 52/53] char: Remove unwanted crlf conversion, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 51/53] qdev: Remove DeviceClass::init() and ::exit(), Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 53/53] memory: Make operations using MemoryRegionIoeventfd struct pass by pointer., Paolo Bonzini, 2018/05/31