target: fix possible memory leak in core_tpg_register()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 15 Mar 2013 09:19:26 +0000 (17:19 +0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 18 Mar 2013 19:45:52 +0000 (12:45 -0700)
'se_tpg->tpg_lun_list' is malloced in core_tpg_register() and should be freed
before leaving from the error handling cases, otherwise it will cause memory
leak.
'se_tpg' is malloced out of this function, and will be freed if we return error, so
remove free for 'se_tpg'.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

No differences found