Fix: ust-consumerd: leak of stream control structure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Mar 2022 22:52:33 +0000 (17:52 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Mar 2022 20:22:17 +0000 (15:22 -0500)
commit7a843330fa4fb0e5f7139970b9b3f38292bc45c8
treecffd30c4f1f592f2ac00f1951b385f54990d9bdf
parent4872076767c2e6e033b3bae4d3c909b3c713bb66
Fix: ust-consumerd: leak of stream control structure

The following leak is reported by LeakSanitizer when
setup_metadata() fails to send the metadata stream to the relay
daemon:

  ==3050181==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 240 byte(s) in 5 object(s) allocated from:
      #0 0x7f5fce02cfb9 in __interceptor_calloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
      #1 0x7f5fcdd95a7a in zmalloc ../../../src/common/macros.h:23
      #2 0x7f5fcdd95a7a in lttng_ust_ctl_create_stream /home/jgalar/EfficiOS/src/lttng-ust/src/lib/lttng-ust-ctl/ustctl.c:1649

A consumer stream can have an allocated
`struct lttng_ust_ctl_consumer_stream *` (ustream) even if it is
not globally visible at the time of its teardown.

In the case of the user space consumer, the only site that creates
consumer stream instances ensures that the allocation of the
lttng_ust_ctl_consumer_stream succeeded, ensuring that the
consumer stream's 'ustream' is always set.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia4be7969e85bd8812ae13b042e1e100812a63c1d
src/common/consumer/consumer-stream.c
This page took 0.025096 seconds and 4 git commands to generate.