From 1f2292f6d16cea53dc94c0e16ab08eb71b70b938 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 12 Sep 2019 09:50:29 -0400 Subject: [PATCH] Clean-up: suppress bogus scan-build warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit scan-build seems confused about the address passed to free() and reports that chunk elements are passed with an offset of 8 bytes from the address that was returned by calloc(). Move the inner-trace chunk of an element to the start of the element wrapper-structure to silence this warning. Signed-off-by: Jérémie Galarneau --- src/common/trace-chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/trace-chunk.c b/src/common/trace-chunk.c index f7a4372b4..908bdf9fe 100644 --- a/src/common/trace-chunk.c +++ b/src/common/trace-chunk.c @@ -91,8 +91,8 @@ struct lttng_trace_chunk { /* A trace chunk is uniquely identified by its (session id, chunk id) tuple. */ struct lttng_trace_chunk_registry_element { - uint64_t session_id; struct lttng_trace_chunk chunk; + uint64_t session_id; /* Weak and only set when added. */ struct lttng_trace_chunk_registry *registry; struct cds_lfht_node trace_chunk_registry_ht_node; -- 2.34.1