Clean-up: suppress bogus scan-build warning
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 Sep 2019 13:50:29 +0000 (09:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 Sep 2019 13:50:29 +0000 (09:50 -0400)
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 <jeremie.galarneau@efficios.com>
src/common/trace-chunk.c

index f7a4372b42df11140e0d9ced34c15d60ff6534fd..908bdf9fee148836202af6738167a58dec28f20b 100644 (file)
@@ -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;
This page took 0.025937 seconds and 4 git commands to generate.