test_read6_simple: Avoid triggering a use-after-free
Do not use the 'task' pointer after the memory it points at has been freed. Detected via valgrind. Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
4653cd8df4
commit
1337185fe9
@@ -70,7 +70,6 @@ test_read6_simple(void)
|
|||||||
if (task->status != SCSI_STATUS_GOOD) {
|
if (task->status != SCSI_STATUS_GOOD) {
|
||||||
logging(LOG_NORMAL, "[FAILED] READ6 command: "
|
logging(LOG_NORMAL, "[FAILED] READ6 command: "
|
||||||
"failed with sense. %s", iscsi_get_error(iscsic));
|
"failed with sense. %s", iscsi_get_error(iscsic));
|
||||||
scsi_free_scsi_task(task);
|
|
||||||
}
|
}
|
||||||
CU_ASSERT_EQUAL(task->status, SCSI_STATUS_GOOD);
|
CU_ASSERT_EQUAL(task->status, SCSI_STATUS_GOOD);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user