net: fix leak of fd in bind() error path
[fio.git] / engines / net.c
index fcf4b8984cd612d1a25d849f2e295ba3935222cf..d036a581811ac5b945ae074169b90f66f090142f 100644 (file)
@@ -1092,6 +1092,7 @@ static int fio_netio_setup_listen_inet(struct thread_data *td, short port)
        }
 
        if (bind(fd, saddr, len) < 0) {
+               close(fd);
                td_verror(td, errno, "bind");
                return 1;
        }