Fix: relayd: Explicit null dereferenced
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 27 Sep 2019 15:49:23 +0000 (11:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 00:31:33 +0000 (20:31 -0400)
Coverity warns about an explicit null dereference on an early exit path.

Coverity report:
  CID 1405577 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)7.
  var_deref_model: Passing null pointer previous_stream_fd to
  stream_fd_put, which dereferences it.

Reported-by: Coverity (1405577) Explicit null dereferenced
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/stream-fd.c

index e376fa1684062ef681939a0a7827d61b3f88825c..f8c0c5343de9c93a22125cfeebc17d1a6e3d177d 100644 (file)
@@ -53,5 +53,8 @@ static void stream_fd_release(struct urcu_ref *ref)
 
 void stream_fd_put(struct stream_fd *sf)
 {
+       if (!sf) {
+               return;
+       }
        urcu_ref_put(&sf->ref, stream_fd_release);
 }
This page took 0.025513 seconds and 4 git commands to generate.