From 603643fa71d5f3523e81bbda079eeebbeaeb2273 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Thu, 8 Feb 2018 21:47:21 +0100 Subject: [PATCH] input/raw_analog: silence "use after free" compiler warning The cleanup() call will void the memory which 'inc' points to. Move the dereference before the release. This was reported by clang's scan-build. --- src/input/raw_analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/raw_analog.c b/src/input/raw_analog.c index f6a02635..68ac1c95 100644 --- a/src/input/raw_analog.c +++ b/src/input/raw_analog.c @@ -271,8 +271,8 @@ static int reset(struct sr_input *in) { struct context *inc = in->priv; - cleanup(in); inc->started = FALSE; + cleanup(in); g_string_truncate(in->buf, 0); return SR_OK;