Skip to content

Commit

Permalink
fix leak in variable_from_die
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow authored and Rot127 committed Jan 8, 2025
1 parent 77e66c0 commit c97d4ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions librz/arch/dwarf_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1696,12 +1696,14 @@ static bool variable_from_die(
RZ_BORROW RZ_IN RZ_NONNULL DwContext *ctx,
RZ_BORROW RZ_IN RZ_NONNULL const RzBinDwarfDie *die) {
RzAnalysisDwarfVariable v = { 0 };
bool res = false;
if (!function_var_parse(ctx, NULL, NULL, &v, die, NULL)) {
variable_fini(&v);
return false;
goto beach;
}

return try_create_var_global(ctx, die, &v);
res = try_create_var_global(ctx, die, &v);
beach:
variable_fini(&v);
return res;
}

static void die_parse(DwContext *ctx, RzBinDwarfDie *die) {
Expand Down

0 comments on commit c97d4ee

Please sign in to comment.