]> sigrok.org Git - libsigrok.git/blobdiff - src/output/srzip.c
output: fix options memory leak
[libsigrok.git] / src / output / srzip.c
index c101d3b263e42235a1e12be91b18977cedf7807a..787a2bab6f4a0be4c56051d8caa74e8fa97357e0 100644 (file)
@@ -296,18 +296,6 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
        return SR_OK;
 }
 
-static int cleanup(struct sr_output *o)
-{
-       struct out_context *outc;
-
-       outc = o->priv;
-       g_free(outc->filename);
-       g_free(outc);
-       o->priv = NULL;
-
-       return SR_OK;
-}
-
 static struct sr_option options[] = {
        ALL_ZERO
 };
@@ -320,6 +308,19 @@ static const struct sr_option *get_options(void)
        return options;
 }
 
+static int cleanup(struct sr_output *o)
+{
+       struct out_context *outc;
+
+       outc = o->priv;
+       g_variant_unref(options[0].def);
+       g_free(outc->filename);
+       g_free(outc);
+       o->priv = NULL;
+
+       return SR_OK;
+}
+
 SR_PRIV struct sr_output_module output_srzip = {
        .id = "srzip",
        .name = "srzip",