Avoid that iscsi_reconnect() crashes
In the else branch, set the tmp_iscsi->old_iscsi pointer instead of the iscsi->old_iscsi pointer. Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
@@ -457,7 +457,7 @@ int iscsi_reconnect(struct iscsi_context *iscsi)
|
||||
}
|
||||
tmp_iscsi->old_iscsi = iscsi->old_iscsi;
|
||||
} else {
|
||||
iscsi->old_iscsi = malloc(sizeof(struct iscsi_context));
|
||||
tmp_iscsi->old_iscsi = malloc(sizeof(struct iscsi_context));
|
||||
memcpy(tmp_iscsi->old_iscsi, iscsi, sizeof(struct iscsi_context));
|
||||
}
|
||||
memcpy(iscsi, tmp_iscsi, sizeof(struct iscsi_context));
|
||||
|
||||
Reference in New Issue
Block a user