On 29/09/2016 19:10, Daniel P. Berrange wrote: >> > >> > - acb->task = malloc(sizeof(struct scsi_task)); >> > + acb->task = g_malloc(sizeof(struct scsi_task)); >> > if (acb->task == NULL) { >> > error_report("iSCSI: Failed to allocate task for scsi command. >> > %s", >> > iscsi_get_error(iscsi)); > For every malloc you convert to g_malloc, you must also > convert the corresponding 'free' to 'g_free'. This seems > missing throughout your patch.
Also realloc -> g_realloc when that applies. Finally, checks for allocation errors should be removed after g_malloc (or g_new). Paolo