[PATCH 1/2] fix memory leak in session.c

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

 



From: Feng Li <lifeng1519@xxxxxxxxx>

Memory leaks when memory allocation fails.

Signed-off-by: Feng Li <lifeng1519@xxxxxxxxx>
---
 usr/iscsi/session.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr/iscsi/session.c b/usr/iscsi/session.c
index 22638e7..09d4442 100644
--- a/usr/iscsi/session.c
+++ b/usr/iscsi/session.c
@@ -98,6 +98,7 @@ int session_create(struct iscsi_connection *conn)
 	if (conn->initiator_alias) {
 		session->initiator_alias = strdup(conn->initiator_alias);
 		if (!session->initiator_alias) {
+			free(session->initiator);
 			free(session);
 			return -ENOMEM;
 		}
-- 
2.8.1

--
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