summaryrefslogtreecommitdiffstats
path: root/polyp/socket-client.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-11-18 20:50:44 +0000
committerLennart Poettering <lennart@poettering.net>2004-11-18 20:50:44 +0000
commit8641af3c6d11e3e6710cb946e9a93d0e9f639519 (patch)
treece72b56c7460fed94808ee8023fad89df27c7e12 /polyp/socket-client.c
parenteef235d8795df740eb63cb135bd187b7ab9ac4ea (diff)
* some iochannel fixes
* introduce reference counting in ioline * fix memory leak in socket-client.c * fix double-free error in protocol-esound.c git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@293 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/socket-client.c')
-rw-r--r--polyp/socket-client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/polyp/socket-client.c b/polyp/socket-client.c
index aea38586..c58c7bd4 100644
--- a/polyp/socket-client.c
+++ b/polyp/socket-client.c
@@ -330,6 +330,7 @@ struct pa_socket_client* pa_socket_client_new_string(struct pa_mainloop_api *m,
case KIND_TCP6: {
uint16_t port = default_port;
char *h;
+ int ret;
struct addrinfo hints, *res;
if (!(h = parse_address(p, &port)))
@@ -338,7 +339,10 @@ struct pa_socket_client* pa_socket_client_new_string(struct pa_mainloop_api *m,
memset(&hints, 0, sizeof(hints));
hints.ai_family = kind == KIND_TCP4 ? AF_INET : (kind == KIND_TCP6 ? AF_INET6 : AF_UNSPEC);
- if (getaddrinfo(h, NULL, &hints, &res) < 0 || !res || !res->ai_addr)
+ ret = getaddrinfo(h, NULL, &hints, &res);
+ pa_xfree(h);
+
+ if (ret < 0 || !res || !res->ai_addr)
return NULL;
if (res->ai_family == AF_INET) {