From: Francis Deslauriers Date: Fri, 27 Sep 2019 15:49:23 +0000 (-0400) Subject: Fix: relayd: Explicit null dereferenced X-Git-Tag: v2.12.0-rc1~330 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5a72475c0a40375466410814049c218cb1755ab3;p=lttng-tools.git Fix: relayd: Explicit null dereferenced 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 --- 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); }