From ac25baa5ee2766d78d29954c006b903fe9f56608 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 16 Apr 2021 10:58:35 +0200 Subject: [PATCH] codec/rfx: Silence BAD_FREE reported by Coverity The `rfx_context_free` function uses the `rfx_message_free` function with an address of the statically allocated `RFX_MESSAGE` struct. This causes that the following is reported from covscan: ``` address_free: "rfx_message_free" frees address of "context->currentMessage". ``` I am convinced that this is just false-positive as the address is freed only when `freeArray` is `0`, which is not in case of `RFX_CONTEXT`. Let's add a code annotation to silence the false-positive next time. --- libfreerdp/codec/rfx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index d30a67e43..c13ecd36b 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -369,6 +369,7 @@ void rfx_context_free(RFX_CONTEXT* context) assert(NULL != context->priv->TilePool); assert(NULL != context->priv->BufferPool); priv = context->priv; + /* coverity[address_free] */ rfx_message_free(context, &context->currentMessage); free(context->quants); ObjectPool_Free(priv->TilePool);