From: Francis Deslauriers Date: Mon, 16 Sep 2019 14:59:37 +0000 (-0400) Subject: Fix: flt.lttng-utils.debug-info: bin-info.c: Dereferencing null pointer X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=c449a5c3412c92591d6eead8b25e1ea239427801 Fix: flt.lttng-utils.debug-info: bin-info.c: Dereferencing null pointer Coverity reported the following: CID 1401211 (#1 of 1): Dereference after null check (FORWARD_NULL)4. var_deref_op: Dereferencing null pointer bin. Reported-by: Coverity - 1401211 Dereference after null check (FORWARD_NULL) Signed-off-by: Francis Deslauriers Change-Id: I66c3dc42305b1c14a5567141274249c6e6b10082 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2050 Tested-by: jenkins Reviewed-by: Simon Marchi --- diff --git a/src/plugins/lttng-utils/debug-info/bin-info.c b/src/plugins/lttng-utils/debug-info/bin-info.c index 149236e8..31c347ea 100644 --- a/src/plugins/lttng-utils/debug-info/bin-info.c +++ b/src/plugins/lttng-utils/debug-info/bin-info.c @@ -488,7 +488,9 @@ int bin_info_set_dwarf_info_from_path(struct bin_info *bin, char *path) return 0; error: - bt_fd_cache_put_handle(bin->fd_cache, dwarf_handle); + if (bin) { + bt_fd_cache_put_handle(bin->fd_cache, dwarf_handle); + } dwarf_end(dwarf_info); g_free(dwarf_info); free(cu);