From: Bert Vermeulen Date: Sat, 4 Aug 2012 10:03:05 +0000 (+0200) Subject: sr: properly free probes when freeing their device instance X-Git-Tag: dsupstream~730 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d3cff734e550430027f195317650a6c0e7c81fa3;p=libsigrok.git sr: properly free probes when freeing their device instance --- diff --git a/device.c b/device.c index e9f6c7bc..cbb38534 100644 --- a/device.c +++ b/device.c @@ -209,11 +209,21 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi) { + struct sr_probe *probe; + GSList *l; + + for (l = sdi->probes; l; l = l->next) { + probe = l->data; + g_free(probe->name); + g_free(probe); + } + g_free(sdi->priv); g_free(sdi->vendor); g_free(sdi->model); g_free(sdi->version); g_free(sdi); + } #ifdef HAVE_LIBUSB_1_0