From: Francis Deslauriers Date: Tue, 1 Oct 2019 13:48:49 +0000 (-0400) Subject: Fix: relayd: Dereference after null check X-Git-Tag: v2.12.0-rc1~336 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=cd65fb868140e522fa520a4735d81a93038963e9 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); }