Commit d09be67d authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

lib/iscsi: fix possible memory leak.



If we fail to allocate all of the params, we should free
the ones we did.

Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: I0f0be6320b27211e3713d9b79b5a0b0ed103e7d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2007


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
parent e5c4b633
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1342,6 +1342,7 @@ iscsi_op_login_store_incoming_params(struct spdk_iscsi_conn *conn,
				&conn->partial_text_parameter);
	if (rc < 0) {
		SPDK_ERRLOG("iscsi_parse_params() failed\n");
		iscsi_param_free(*params);
		rsph->status_class = ISCSI_CLASS_INITIATOR_ERROR;
		rsph->status_detail = ISCSI_LOGIN_INITIATOR_ERROR;
		return SPDK_ISCSI_LOGIN_ERROR_PARAMETER;