]> sigrok.org Git - libsigrok.git/commitdiff
srzip: don't access non-existing option
authorGerhard Sittig <redacted>
Sun, 28 Jan 2018 17:58:19 +0000 (18:58 +0100)
committerGerhard Sittig <redacted>
Fri, 9 Feb 2018 20:59:18 +0000 (21:59 +0100)
The srzip output module dropped support for the "filename" option in
commit 37875f750614 on 2015-07-30, but still used to assign to slot
options[0] which clobbers the array's sentinel. Remove those accesses
to the non-existing option.

src/output/srzip.c

index 6357a1c9072f7ddd5d9c4409bc456a8d78ab10f9..84938ad2b741f431117c0a433bf782ed5a9c241f 100644 (file)
@@ -465,9 +465,6 @@ static struct sr_option options[] = {
 
 static const struct sr_option *get_options(void)
 {
-       if (!options[0].def)
-               options[0].def = g_variant_ref_sink(g_variant_new_string(""));
-
        return options;
 }
 
@@ -476,7 +473,6 @@ static int cleanup(struct sr_output *o)
        struct out_context *outc;
 
        outc = o->priv;
-       g_variant_unref(options[0].def);
        g_free(outc->analog_index_map);
        g_free(outc->filename);
        g_free(outc);