From ca258a7d30510f01d0760f4f529fed2bb5821b9a Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 1 Oct 2019 14:21:00 -0400 Subject: [PATCH] Fix: session-descriptor.c: Dereference before null check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Coverity report: CID 1400682 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking descriptor suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Reported-by: (1400682) Dereference before null check Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- src/common/session-descriptor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/session-descriptor.c b/src/common/session-descriptor.c index 713731c3e..6dea5ee7c 100644 --- a/src/common/session-descriptor.c +++ b/src/common/session-descriptor.c @@ -522,6 +522,10 @@ _lttng_session_descriptor_live_network_create( descriptor = _lttng_session_descriptor_live_create(name, live_timer_interval_us); + if (!descriptor) { + goto error; + } + descriptor->base.output_type = LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK; -- 2.34.1