Skip to content

Commit 3db19a4

Browse files
authored
librz/bin/wasm: fix memory leaks. (#5941)
1 parent ddc361c commit 3db19a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

librz/bin/p/bin_wasm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ static RzStructuredData *wasm_types_structure(RzBinFile *bf) {
405405
RzStructuredData *params = rz_structured_data_new_array();
406406
if (!params) {
407407
rz_structured_data_free(arr);
408+
rz_structured_data_free(m);
408409
return NULL;
409410
}
410411
for (ut32 i = 0; i < type->param_count; i++) {
@@ -631,6 +632,7 @@ static RzStructuredData *wasm_elements_structure(RzBinFile *bf) {
631632
RzStructuredData *elems = rz_structured_data_new_array();
632633
if (!elems) {
633634
rz_structured_data_free(arr);
635+
rz_structured_data_free(m);
634636
return NULL;
635637
}
636638
for (ut32 i = 0; i < element->num_elem; i++) {

0 commit comments

Comments
 (0)