]> sigrok.org Git - libsigrok.git/commitdiff
lascar-el-usb: fix memory leak
authorDaniel Glöckner <redacted>
Sat, 22 Aug 2015 15:31:43 +0000 (17:31 +0200)
committerUwe Hermann <redacted>
Sun, 30 Aug 2015 16:51:18 +0000 (18:51 +0200)
This fixes bug #630.

src/hardware/lascar-el-usb/protocol.c

index ba60fe3bc95fa82434e9d1dd353f9a20c96f140d..bccf7b6a685f5ade06818816cd1d7207cc8539bf 100644 (file)
@@ -436,6 +436,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
                                analog.unit = SR_UNIT_CELSIUS;
                        analog.data = temp;
                        sr_session_send(devc->cb_data, &packet);
+                       g_slist_free(analog.channels);
                }
 
                ch = sdi->channels->next->data;
@@ -445,6 +446,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
                        analog.unit = SR_UNIT_PERCENTAGE;
                        analog.data = rh;
                        sr_session_send(devc->cb_data, &packet);
+                       g_slist_free(analog.channels);
                }
 
                g_free(temp);