]> sigrok.org Git - libsigrok.git/commitdiff
Fix various memory leaks
authorBert Vermeulen <redacted>
Sun, 5 May 2013 22:40:17 +0000 (00:40 +0200)
committerBert Vermeulen <redacted>
Sun, 5 May 2013 22:40:17 +0000 (00:40 +0200)
device.c

index a49faa8d595df9c05743adb9ec5fbce6b79898e2..486acfd0cf703298f2b112baa46b557c2f5c1d52 100644 (file)
--- a/device.c
+++ b/device.c
@@ -258,10 +258,11 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
        for (l = sdi->probes; l; l = l->next) {
                probe = l->data;
                g_free(probe->name);
+               g_free(probe->trigger);
                g_free(probe);
        }
+       g_slist_free(sdi->probes);
 
-       g_free(sdi->priv);
        g_free(sdi->vendor);
        g_free(sdi->model);
        g_free(sdi->version);
@@ -291,9 +292,7 @@ SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus,
 /** @private */
 SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb)
 {
-       (void)usb;
-
-       /* Nothing to do for this device instance type. */
+       g_free(usb);
 }
 
 #endif