summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-11-03 11:47:58 +0200
committerDavid Henningsson <david.henningsson@canonical.com>2015-02-12 20:33:44 +0100
commit73dee7c9f7fff28ddc5ca6eeded26ef8c41fe761 (patch)
treef8b3d69f2f2dff5e8f5ac257bc511d5cd5fce524
parent53ad8aa7caa33caac52e35f71253e29d5a15f6e7 (diff)
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.
-rw-r--r--src/pulsecore/socket-server.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pulsecore/socket-server.c b/src/pulsecore/socket-server.c
index d1f83f41b..ce6169424 100644
--- a/src/pulsecore/socket-server.c
+++ b/src/pulsecore/socket-server.c
@@ -298,10 +298,10 @@ pa_socket_server* pa_socket_server_new_ipv4(pa_mainloop_api *m, uint32_t address
goto fail;
}
- if ((ss = pa_socket_server_new(m, fd))) {
- ss->type = SOCKET_SERVER_IPV4;
- ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
- }
+ pa_assert_se(ss = pa_socket_server_new(m, fd));
+
+ ss->type = SOCKET_SERVER_IPV4;
+ ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
return ss;
@@ -366,10 +366,10 @@ pa_socket_server* pa_socket_server_new_ipv6(pa_mainloop_api *m, const uint8_t ad
goto fail;
}
- if ((ss = pa_socket_server_new(m, fd))) {
- ss->type = SOCKET_SERVER_IPV6;
- ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
- }
+ pa_assert_se(ss = pa_socket_server_new(m, fd));
+
+ ss->type = SOCKET_SERVER_IPV6;
+ ss->tcpwrap_service = pa_xstrdup(tcpwrap_service);
return ss;