From: Daniel Glöckner Date: Sat, 22 Aug 2015 15:19:33 +0000 (+0200) Subject: es51919: fix memory leak X-Git-Tag: libsigrok-0.4.0~371 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=80e20c10e3de3250f339affbf2abcd4b832f7b60;p=libsigrok.git es51919: fix memory leak This fixes bug #629. --- diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index 0e8635f6..3b028524 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -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);