Merge pull request #147 from plieven/destroy_segfault2
init: fix segfault in iscsi_destroy_context
This commit is contained in:
@@ -295,7 +295,7 @@ iscsi_destroy_context(struct iscsi_context *iscsi)
|
|||||||
/* If an error happened during connect/login, we don't want to
|
/* If an error happened during connect/login, we don't want to
|
||||||
call any of the callbacks.
|
call any of the callbacks.
|
||||||
*/
|
*/
|
||||||
if (iscsi->is_loggedin) {
|
if (iscsi->is_loggedin && pdu->callback != NULL) {
|
||||||
pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL,
|
pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL,
|
||||||
pdu->private_data);
|
pdu->private_data);
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@ iscsi_destroy_context(struct iscsi_context *iscsi)
|
|||||||
/* If an error happened during connect/login, we don't want to
|
/* If an error happened during connect/login, we don't want to
|
||||||
call any of the callbacks.
|
call any of the callbacks.
|
||||||
*/
|
*/
|
||||||
if (iscsi->is_loggedin) {
|
if (iscsi->is_loggedin && pdu->callback != NULL) {
|
||||||
pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL,
|
pdu->callback(iscsi, SCSI_STATUS_CANCELLED, NULL,
|
||||||
pdu->private_data);
|
pdu->private_data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user