diff mbox series

[53/88] iSCSI: use g_new() family of functions

Message ID 20171006235023.11952-54-f4bug@amsat.org
State New
Headers show
Series use g_new() family of functions | expand

Commit Message

Philippe Mathieu-Daudé Oct. 6, 2017, 11:49 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 block/iscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/iscsi.c b/block/iscsi.c
index 4683f3b244..f9f910168d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1001,7 +1001,7 @@  static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs,
         return NULL;
     }
 
-    acb->task = malloc(sizeof(struct scsi_task));
+    acb->task = g_new(struct scsi_task, 1);
     if (acb->task == NULL) {
         error_report("iSCSI: Failed to allocate task for scsi command. %s",
                      iscsi_get_error(iscsi));