From 9ec12158b0d45d51509f16e762cc09b83f7a402f Mon Sep 17 00:00:00 2001 From: zeroway Date: Fri, 19 Jan 2024 17:41:54 +0800 Subject: [PATCH] Manually set task to null after free to avoid double free issue --- lib/scsi-lowlevel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 1b49853..0ced6a2 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -80,6 +80,8 @@ scsi_free_scsi_task(struct scsi_task *task) free(task->datain.data); free(task); + task->datain.data = NULL; + task = NULL; } struct scsi_task *