Skip to content

Commit

Permalink
fix the Memory leak: ret (#4038)
Browse files Browse the repository at this point in the history
When the opsize is greater than 2 and memory allocation is successful, it will cause a memory leak

Signed-off-by: zengwei [email protected]
  • Loading branch information
zengwei00 committed Dec 20, 2023
1 parent 9b227eb commit ba4be10
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions librz/analysis/p/analysis_avr.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ static ut8 *analysis_mask_avr(RzAnalysis *analysis, int size, const ut8 *data, u
rz_strbuf_fini(&sb);

if (opsize < 2 || !(ret = malloc(opsize))) {
free(ret);
rz_analysis_op_free(op);
return NULL;
}
Expand Down

0 comments on commit ba4be10

Please sign in to comment.