From ae98d764c5a593eb08414d8f12331c9719398d86 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 12 Feb 2007 00:11:09 +0100 Subject: [PATCH] dccp_recv.c: Fix memory leak in dccp_recv_open() Missing freeaddrinfo(). --- dccp_recv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dccp_recv.c b/dccp_recv.c index 943b8283..4883e4a2 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -95,9 +95,12 @@ static int dccp_recv_open(struct receiver_node *rn) if (ret < 0) goto err_out; PARA_NOTICE_LOG("connecting to %s:%d\n", conf->host_arg, conf->port_arg); - ret = -E_DCCP_CONNECT; - if (connect(pdd->fd, ai->ai_addr, ai->ai_addrlen) < 0) + ret = connect(pdd->fd, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); + if (ret < 0) { + ret = -E_DCCP_CONNECT; goto err_out; + } mark_fd_nonblock(pdd->fd); return 1; err_out: -- 2.39.5