From 5a72475c0a40375466410814049c218cb1755ab3 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Fri, 27 Sep 2019 11:49:23 -0400 Subject: [PATCH] Fix: relayd: Explicit null dereferenced MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/stream-fd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/lttng-relayd/stream-fd.c b/src/bin/lttng-relayd/stream-fd.c index e376fa168..f8c0c5343 100644 --- a/src/bin/lttng-relayd/stream-fd.c +++ b/src/bin/lttng-relayd/stream-fd.c @@ -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); } -- 2.34.1