Reported-by: Address Sanitizer - Memory Leak
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I4591884681920fc6068572dcdb1923f82c9f81d6
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1351
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins
const char *filename = NULL;
Dwarf_Line *line = NULL;
Dwarf_Addr line_addr;
- int ret, line_no;
+ int ret = 0, line_no;
if (!cu || !src_loc) {
goto error;
_src_loc->filename = g_strdup(filename);
}
- bt_dwarf_die_destroy(die);
-
if (_src_loc) {
*src_loc = _src_loc;
}
-end:
- return 0;
+ goto end;
error:
source_location_destroy(_src_loc);
+ ret = -1;
+end:
bt_dwarf_die_destroy(die);
- return -1;
+ return ret;
}
/**