From 8641af3c6d11e3e6710cb946e9a93d0e9f639519 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Nov 2004 20:50:44 +0000 Subject: * 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 --- polyp/socket-client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'polyp/socket-client.c') 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) { -- cgit