]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lascar-el-usb/protocol.c
lascar-el-usb: fix memory leak
[libsigrok.git] / src / hardware / lascar-el-usb / protocol.c
index 3dad7943ef78e816e865fee81291fff325885ebf..bccf7b6a685f5ade06818816cd1d7207cc8539bf 100644 (file)
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <math.h>
 #include <glib.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
@@ -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);