]> sigrok.org Git - libsigrok.git/blobdiff - src/input/chronovu_la8.c
input: fix leak of config data in several input modules
[libsigrok.git] / src / input / chronovu_la8.c
index 97eac15040850d0fa4977b1c461a2c916471a7bf..f42886ed87e21037b83efc443856952a9dfe3033 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#include <config.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -94,6 +95,7 @@ static int process_buffer(struct sr_input *in)
                        src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->samplerate));
                        meta.config = g_slist_append(NULL, src);
                        sr_session_send(in->sdi, &packet);
+                       g_slist_free(meta.config);
                        sr_config_free(src);
                }
 
@@ -161,7 +163,7 @@ static struct sr_option options[] = {
        ALL_ZERO
 };
 
-static struct sr_option *get_options(void)
+static const struct sr_option *get_options(void)
 {
        if (!options[0].def) {
                options[0].def = g_variant_ref_sink(g_variant_new_int32(DEFAULT_NUM_CHANNELS));