Fix: relayd: Dereference after null check
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 1 Oct 2019 13:48:49 +0000 (09:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 00:31:33 +0000 (20:31 -0400)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/sessiond-trace-chunks.c

index 495227226e8a4bcb5f48c62a607ae29e1ce91336..f2dfa23a11826d935ec1e2f189d9bdeef4e6b958 100644 (file)
@@ -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);
 }
 
This page took 0.025748 seconds and 4 git commands to generate.