X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Finput%2Fraw_analog.c;h=811c01e8501a82f19f0fd49098255c4406eedd6d;hb=b8fcae5a128e2ca3143e05a799f80852ebd911b7;hp=272250eb2945b06f8a648e9cb24583d13b9139fe;hpb=b20eb52055042a1a1dd61d928a3f3a4b706c7d01;p=libsigrok.git diff --git a/src/input/raw_analog.c b/src/input/raw_analog.c index 272250eb..811c01e8 100644 --- a/src/input/raw_analog.c +++ b/src/input/raw_analog.c @@ -256,15 +256,13 @@ static const struct sr_option *get_options(void) static void cleanup(struct sr_input *in) { - struct context *inc; + g_free(in->priv); + in->priv = NULL; - inc = in->priv; g_variant_unref(options[0].def); g_variant_unref(options[1].def); g_variant_unref(options[2].def); g_slist_free_full(options[2].values, (GDestroyNotify)g_variant_unref); - g_free(inc); - in->priv = NULL; } static int reset(struct sr_input *in) @@ -272,7 +270,7 @@ static int reset(struct sr_input *in) struct context *inc = in->priv; inc->started = FALSE; - cleanup(in); + g_string_truncate(in->buf, 0); return SR_OK;