]> Git Repo - qemu.git/blobdiff - blockdev-nbd.c
char: xilinx_uartlite: Don't reset from init
[qemu.git] / blockdev-nbd.c
index 922cf5657b99f23f4a8afc707c0e0bf79d03bbd0..b60b66d66c2bbe7eaea66abd7a3f3d27e638c82b 100644 (file)
@@ -27,8 +27,8 @@ static void nbd_accept(void *opaque)
     socklen_t addr_len = sizeof(addr);
 
     int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len);
-    if (fd >= 0) {
-        nbd_client_new(NULL, fd, nbd_client_put);
+    if (fd >= 0 && !nbd_client_new(NULL, fd, nbd_client_put)) {
+        close(fd);
     }
 }
 
This page took 0.023633 seconds and 4 git commands to generate.