stgt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roi Dayan <roid@mellanox.com>
To: fujita.tomonori@lab.ntt.co.jp
Cc: stgt@vger.kernel.org, Roi Dayan <roid@mellanox.com>
Subject: [PATCH] iser: Fix memory leak of addrinfo struct
Date: Wed, 29 Apr 2015 15:31:23 +0300	[thread overview]
Message-ID: <1430310683-17664-1-git-send-email-roid@mellanox.com> (raw)

Signed-off-by: Roi Dayan <roid@mellanox.com>
---
 usr/iscsi/iser.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/usr/iscsi/iser.c b/usr/iscsi/iser.c
index f262ed6..9519862 100644
--- a/usr/iscsi/iser.c
+++ b/usr/iscsi/iser.c
@@ -3452,10 +3452,14 @@ static int iser_ib_init(void)
 
 	for (res = res0; res; res = res->ai_next) {
 		err = iser_add_portal(res, port);
-		if (err)
+		if (err) {
+		    freeaddrinfo(res0);
 		    return err;
+		}
 	}
 
+	freeaddrinfo(res0);
+
 	dprintf("listening for iser connections on port %d\n", port);
 	err = tgt_event_add(rdma_evt_channel->fd, EPOLLIN,
 			    iser_handle_rdmacm, NULL);
-- 
1.8.4.3

             reply	other threads:[~2015-04-29 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 12:31 Roi Dayan [this message]
2015-04-29 12:34 ` [PATCH] iser: Fix memory leak of addrinfo struct FUJITA Tomonori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430310683-17664-1-git-send-email-roid@mellanox.com \
    --to=roid@mellanox.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=stgt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).