X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdevice.c;h=aa499c8d74252ad07a37cf54afbec3b1233196ce;hb=95723b1e178ff2f8f30d4d338840da4f61b3643b;hp=a8f6f2b4dce9c0695961cbd1ec618f4d5f201ab3;hpb=5801ce7840c72775fbcfaf39e0587f767f070efd;p=libsigrok.git diff --git a/src/device.c b/src/device.c index a8f6f2b4..aa499c8d 100644 --- a/src/device.c +++ b/src/device.c @@ -136,7 +136,9 @@ SR_API int sr_dev_channel_enable(struct sr_channel *channel, gboolean state) } /* Returns the next enabled channel, wrapping around if necessary. */ +/** @private */ SR_PRIV struct sr_channel *sr_next_enabled_channel(const struct sr_dev_inst *sdi, + struct sr_channel *cur_channel) { struct sr_channel *next_channel; @@ -489,6 +491,9 @@ SR_PRIV struct sr_usbtmc_dev_inst *sr_usbtmc_dev_inst_new(const char *device) /** @private */ SR_PRIV void sr_usbtmc_dev_inst_free(struct sr_usbtmc_dev_inst *usbtmc) { + if (!usbtmc) + return; + g_free(usbtmc->device); g_free(usbtmc); }