es51919: fix memory leak

This fixes bug #629.
This commit is contained in:
Daniel Glöckner 2015-08-22 17:19:33 +02:00 committed by Uwe Hermann
parent d40b8557a9
commit 80e20c10e3
1 changed files with 3 additions and 0 deletions

View 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); sr_session_send(devc->cb_data, &packet);
} }
g_slist_free(analog.channels);
analog.channels = g_slist_append(NULL, sdi->channels->next->data); analog.channels = g_slist_append(NULL, sdi->channels->next->data);
parse_measurement(pkt, &floatval, &analog, 1); 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); sr_session_send(devc->cb_data, &packet);
} }
g_slist_free(analog.channels);
if (frame) { if (frame) {
packet.type = SR_DF_FRAME_END; packet.type = SR_DF_FRAME_END;
sr_session_send(devc->cb_data, &packet); sr_session_send(devc->cb_data, &packet);