Fix: multiple memory release issues (#5616)
This commit is contained in:
parent
2e63297dd2
commit
728b7bec9a
7 changed files with 13 additions and 3 deletions
|
|
@ -73,7 +73,7 @@ RZ_API bool rz_analysis_esil_load_interrupts(RzAnalysisEsil *esil, RzAnalysisEsi
|
|||
return false;
|
||||
}
|
||||
if (!rz_analysis_esil_set_interrupt(esil, intr)) {
|
||||
free(intr);
|
||||
rz_analysis_esil_interrupt_free(esil, intr);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ static void get_objc_property_list(mach0_ut p, RzBinFile *bf, RzBuffer *buf, RzB
|
|||
}
|
||||
return;
|
||||
error:
|
||||
RZ_FREE(property);
|
||||
rz_bin_class_field_free(property);
|
||||
RZ_FREE(name);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ static struct MACH0_(obj_t) * bin_to_mach0(RzBinFile *bf, RzDyldBinImage *bin) {
|
|||
|
||||
struct MACH0_(obj_t) *mach0 = MACH0_(new_buf)(buf, &opts);
|
||||
if (!mach0) {
|
||||
rz_buf_free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ RZ_IPI bool PDBSymbolIter_next(PDBSymbolIter *iter, PDBSymbol *symbol) {
|
|||
if (!symbol->data) {
|
||||
goto loop_continue;
|
||||
}
|
||||
rz_buf_free(b);
|
||||
return true;
|
||||
}
|
||||
loop_continue:
|
||||
|
|
|
|||
|
|
@ -1181,7 +1181,7 @@ static int GH(print_double_linked_list_bin_graph)(RzCore *core, GHT bin, MallocS
|
|||
if (next < brk_start || next > main_arena->top) {
|
||||
PRINT_RA("Double linked list corrupted\n");
|
||||
free(cnk);
|
||||
free(g);
|
||||
rz_agraph_free(g);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ bool test_rz_inflate_buf(void) {
|
|||
mu_assert_notnull(inflated, "rz_buf_read failed");
|
||||
mu_assert_memeq(inflated, (unsigned char *)test_cases[i].inflated, strlen(test_cases[i].inflated), "rz_inflate_buf does not return expected output");
|
||||
free(inflated);
|
||||
rz_buf_free(deflated_buf);
|
||||
rz_buf_free(inflated_buf);
|
||||
}
|
||||
|
||||
mu_end;
|
||||
|
|
@ -71,6 +73,8 @@ bool test_rz_deflate_buf(void) {
|
|||
mu_assert_notnull(deflated, "rz_buf_read failed");
|
||||
mu_deflated_eq(deflated, (unsigned char *)test_cases[i].deflated, test_cases[i].deflated_length, "rz_deflate_buf does not return expected output");
|
||||
free(deflated);
|
||||
rz_buf_free(deflated_buf);
|
||||
rz_buf_free(inflated_buf);
|
||||
}
|
||||
|
||||
mu_end;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ bool test_rz_lzma_dec(void) {
|
|||
mu_assert_notnull(inflated, "rz_buf_read failed");
|
||||
mu_assert_streq(inflated, test_cases[i].inflated, "rz_lzma_dec_buf does not return expected output");
|
||||
free(inflated);
|
||||
rz_buf_free(deflated_buf);
|
||||
rz_buf_free(inflated_buf);
|
||||
}
|
||||
|
||||
mu_end;
|
||||
|
|
@ -47,6 +49,8 @@ bool test_rz_lzma_enc(void) {
|
|||
rz_buf_read_at(deflated_buf, 0, deflated, test_cases[i].deflated_length);
|
||||
mu_deflated_eq(deflated, (unsigned char *)test_cases[i].deflated, test_cases[i].deflated_length, "rz_lzma_enc_buf does not return expected output");
|
||||
free(deflated);
|
||||
rz_buf_free(inflated_buf);
|
||||
rz_buf_free(deflated_buf);
|
||||
}
|
||||
|
||||
mu_end;
|
||||
|
|
|
|||
Loading…
Reference in a new issue