raop: Fail after search for port number

should also fail if port is 0 after the loop, as suggested by Georg Chini

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald-Stadler 2017-03-07 08:22:25 +01:00
parent df9cda67d2
commit 95d850a5ad

View file

@ -811,6 +811,11 @@ static int open_bind_udp_socket(pa_raop_client *c, uint16_t *actual_port) {
} }
} while (++port > 0); } while (++port > 0);
if (!port) {
pa_log("Could not bind port");
goto fail;
}
pa_log_debug("Socket bound to port %d (SOCK_DGRAM)", port); pa_log_debug("Socket bound to port %d (SOCK_DGRAM)", port);
*actual_port = port; *actual_port = port;