init: fix memory leak in iscsi_create_context
iscsi instance is allocated in iscsi_create_context, after we return NULL, nobody could handle it anymore. Currently we can't hit this logic, anyway we still fix this. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
This commit is contained in:
@@ -218,7 +218,7 @@ iscsi_create_context(const char *initiator_name)
|
||||
|
||||
/* initalize transport of context */
|
||||
if (iscsi_init_transport(iscsi, TCP_TRANSPORT)) {
|
||||
iscsi_set_error(iscsi, "Failed allocating transport");
|
||||
free(iscsi);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user