]> sigrok.org Git - libsigrok.git/commitdiff
es51919: fix memory leak
authorDaniel Glöckner <redacted>
Sat, 22 Aug 2015 15:19:33 +0000 (17:19 +0200)
committerUwe Hermann <redacted>
Sun, 30 Aug 2015 16:48:50 +0000 (18:48 +0200)
This fixes bug #629.

src/lcr/es51919.c

index 0e8635f6d06556de841cf1f127927d572ce72983..3b02852427c9394d3ee63c9d4fd2a8b7199bc5fe 100644 (file)
@@ -723,6 +723,7 @@ static void handle_packet(struct sr_dev_inst *sdi, const uint8_t *pkt)
                sr_session_send(devc->cb_data, &packet);
        }
 
+       g_slist_free(analog.channels);
        analog.channels = g_slist_append(NULL, sdi->channels->next->data);
 
        parse_measurement(pkt, &floatval, &analog, 1);
@@ -739,6 +740,8 @@ static void handle_packet(struct sr_dev_inst *sdi, const uint8_t *pkt)
                sr_session_send(devc->cb_data, &packet);
        }
 
+       g_slist_free(analog.channels);
+
        if (frame) {
                packet.type = SR_DF_FRAME_END;
                sr_session_send(devc->cb_data, &packet);