From c222b0167b6a89a1949875d0fe242772733c93af Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 1 Oct 2019 16:06:04 -0400 Subject: [PATCH] Fix: common: Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Coverity report: CID 1404929 (#1 of 1): Dereference after null check (FORWARD_NULL) 25. var_deref_model: Passing null pointer directory_to_rename to lttng_directory_handle_rename_as_user, which dereferences it. Reported-by: Coverity (1404929) Dereference after null check Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- src/common/trace-chunk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/trace-chunk.c b/src/common/trace-chunk.c index affe3ac20..afba60b38 100644 --- a/src/common/trace-chunk.c +++ b/src/common/trace-chunk.c @@ -975,6 +975,7 @@ void lttng_trace_chunk_move_to_completed(struct lttng_trace_chunk *trace_chunk) creation_timestamp, NULL); if (!directory_to_rename) { ERR("Failed to generate initial trace chunk name while renaming trace chunk"); + goto end; } free_directory_to_rename = true; } -- 2.34.1