From: Francis Deslauriers Date: Tue, 1 Oct 2019 13:48:49 +0000 (-0400) Subject: Fix: relayd: Dereference after null check X-Git-Tag: v2.11.0~29 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=26b87c1a5f80595aa21e8b42541719c7feb222f7;p=lttng-tools.git Fix: relayd: Dereference after null check Coverity report: CID 1404934 (#1 of 1): Dereference after null check (FORWARD_NULL) 11. var_deref_model: Passing null pointer element to trace_chunk_registry_ht_element_put, which dereferences it. Reported-by: Coverity (1404934) Dereference after null check Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/sessiond-trace-chunks.c b/src/bin/lttng-relayd/sessiond-trace-chunks.c index 495227226..f2dfa23a1 100644 --- a/src/bin/lttng-relayd/sessiond-trace-chunks.c +++ b/src/bin/lttng-relayd/sessiond-trace-chunks.c @@ -151,6 +151,10 @@ static void trace_chunk_registry_ht_element_put( struct trace_chunk_registry_ht_element *element) { + if (!element) { + return; + } + urcu_ref_put(&element->ref, trace_chunk_registry_ht_element_release); }