mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
socket-server: pa_socket_server_new() can't fail, so don't check its return value
An assertion was already used in pa_socket_server_new_unix(), this makes the TCP variants consistent with that. Even if pa_socket_server_new() could fail, the error handling wasn't good, because there was no "goto fail", meaning that the fd would have been leaked.
This commit is contained in:
parent
53ad8aa7ca
commit
73dee7c9f7
1 changed files with 8 additions and 8 deletions
|
|
@ -298,10 +298,10 @@ pa_socket_server* pa_socket_server_new_ipv4(pa_mainloop_api *m, uint32_t address
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ss = pa_socket_server_new(m, fd))) {
|
pa_assert_se(ss = pa_socket_server_new(m, fd));
|
||||||
ss->type = SOCKET_SERVER_IPV4;
|
|
||||||
ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
|
ss->type = SOCKET_SERVER_IPV4;
|
||||||
}
|
ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
|
||||||
|
|
||||||
return ss;
|
return ss;
|
||||||
|
|
||||||
|
|
@ -366,10 +366,10 @@ pa_socket_server* pa_socket_server_new_ipv6(pa_mainloop_api *m, const uint8_t ad
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ss = pa_socket_server_new(m, fd))) {
|
pa_assert_se(ss = pa_socket_server_new(m, fd));
|
||||||
ss->type = SOCKET_SERVER_IPV6;
|
|
||||||
ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
|
ss->type = SOCKET_SERVER_IPV6;
|
||||||
}
|
ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
|
||||||
|
|
||||||
return ss;
|
return ss;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue