X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdevice.c;h=e7a0c4ffd277bf72c9a85b8946f37c13886df7ff;hb=6fad08e6abfa4e5ee708f584e530c6b611a65cdb;hp=2b6cda03bd9812a9969535c7792489d1bbe242e6;hpb=e8cbb22314f8a1c4aafd55b582281f54d4d35c07;p=libsigrok.git diff --git a/src/device.c b/src/device.c index 2b6cda03..e7a0c4ff 100644 --- a/src/device.c +++ b/src/device.c @@ -247,6 +247,7 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int status, SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi) { struct sr_channel *ch; + struct sr_channel_group *cg; GSList *l; for (l = sdi->channels; l; l = l->next) { @@ -257,8 +258,11 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi) } g_slist_free(sdi->channels); - if (sdi->channel_groups) - g_slist_free(sdi->channel_groups); + for (l = sdi->channel_groups; l; l = l->next) { + cg = l->data; + g_free(cg->priv); + } + g_slist_free(sdi->channel_groups); g_free(sdi->vendor); g_free(sdi->model); @@ -550,6 +554,7 @@ SR_API const char *sr_dev_inst_sernum_get(struct sr_dev_inst *sdi) return sdi->serial_num; } +#ifdef HAVE_LIBUSB_1_0 /** * Queries a device instances' connection identifier. * @@ -617,5 +622,6 @@ SR_API const char *sr_dev_inst_connid_get(struct sr_dev_inst *sdi) return sdi->connection_id; } +#endif /** @} */