Fix: flt.lttng-utils.debug-info: bin-info.c: Dereferencing null pointer
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 16 Sep 2019 14:59:37 +0000 (10:59 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 19 Sep 2019 18:41:17 +0000 (14:41 -0400)
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 <francis.deslauriers@efficios.com>
Change-Id: I66c3dc42305b1c14a5567141274249c6e6b10082
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2050
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/plugins/lttng-utils/debug-info/bin-info.c

index 149236e8bea6be74dd57c500d0ec432c3ab26c5f..31c347ea7088348b32af3efed14d07b12d877f44 100644 (file)
@@ -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);
This page took 0.025627 seconds and 4 git commands to generate.