From: Jérémie Galarneau Date: Thu, 12 Sep 2019 13:50:29 +0000 (-0400) Subject: Clean-up: suppress bogus scan-build warning X-Git-Tag: v2.11.0-rc4~50 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c779502b1d01b1763fc6b5823f7c522bf20ebb4b;p=lttng-tools.git Clean-up: suppress bogus scan-build warning 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 --- 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;