[PATCH] iser: Fix memory leak of addrinfo struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Roi Dayan <roid@xxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux