[Spice-devel] [PATCH spice-gtk 26/44] fixup! usb-redir: add files for SCSI and USB MSC implementation

Frediano Ziglio fziglio at redhat.com
Tue Jul 30 12:03:14 UTC 2019


Remove data_buf leak.
---
 src/cd-usb-bulk-msd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c
index 843f4f2e..41e210f0 100644
--- a/src/cd-usb-bulk-msd.c
+++ b/src/cd-usb-bulk-msd.c
@@ -129,6 +129,7 @@ UsbCdBulkMsdDevice *cd_usb_bulk_msd_alloc(void *usb_user_data, uint32_t max_luns
 
     cd->scsi_target = cd_scsi_target_alloc(cd, max_luns);
     if (cd->scsi_target == NULL) {
+        g_free(cd->data_buf);
         g_free(cd);
         return NULL;
     }
@@ -238,6 +239,7 @@ int cd_usb_bulk_msd_unrealize(UsbCdBulkMsdDevice *cd, uint32_t lun)
 void cd_usb_bulk_msd_free(UsbCdBulkMsdDevice *cd)
 {
     cd_scsi_target_free(cd->scsi_target);
+    g_free(cd->data_buf);
     g_free(cd);
 
     SPICE_DEBUG("Free");
-- 
2.20.1



More information about the Spice-devel mailing list