[SCSI] iscsi bugfixes: fix mem leaks in libiscsi
authorMike Christie <michaelc@cs.wisc.edu>
Mon, 24 Jul 2006 20:47:50 +0000 (15:47 -0500)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Fri, 28 Jul 2006 16:50:02 +0000 (11:50 -0500)
We were leaking some strings. This patch just frees them.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libiscsi.c

index c628c63c51a8366d9a646d77629645106be9e072..5884cd26d53af32ce9fcaf0a8e2d4e12d46dd90a 100644 (file)
@@ -1357,6 +1357,8 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
        iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds);
        iscsi_pool_free(&session->cmdpool, (void**)session->cmds);
 
+       kfree(session->targetname);
+
        iscsi_destroy_session(cls_session);
        scsi_host_put(shost);
        module_put(owner);
@@ -1491,6 +1493,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
 
        spin_lock_bh(&session->lock);
        kfree(conn->data);
+       kfree(conn->persistent_address);
        __kfifo_put(session->mgmtpool.queue, (void*)&conn->login_mtask,
                    sizeof(void*));
        list_del(&conn->item);