Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert RzList basic blocks to RzPVector #4067

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions librz/analysis/fcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ RZ_API int rz_analysis_function_resize(RzAnalysisFunction *fcn, int newsize) {
ut64 eof = fcn->addr + newsize;
rz_pvector_foreach (fcn->bbs, iter) {
bb = *iter;
if(!bb) {
continue;
}
if (bb->addr >= eof) {
rz_analysis_function_remove_block(fcn, bb);
continue;
Expand Down
4 changes: 3 additions & 1 deletion librz/analysis/similarity.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ static RZ_OWN RzAnalysisMatchResult *analysis_match_result_new(RZ_NONNULL RzAnal
return result;

fail:
rz_list_free(list_a);
rz_list_free(list_b);
XVilka marked this conversation as resolved.
Show resolved Hide resolved
rz_th_pool_free(pool);
shared_context_fini(&shared);
rz_list_free(unmatch_a);
Expand Down Expand Up @@ -427,7 +429,7 @@ RZ_API RZ_OWN RzAnalysisMatchResult *rz_analysis_match_basic_blocks(RZ_NONNULL R
RzList *bbs_list_b = rz_list_new();
if (!bbs_list_a || !bbs_list_b) {
// If memory allocation failed, print an error message and return NULL
eprintf("Failed to allocate memory for bbs_list_a or bbs_list_b.\n");
RZ_LOG_ERROR("Failed to allocate memory for bbs_list_a or bbs_list_b.\n");
rz_list_free(bbs_list_a); // It's safe to call rz_list_free with NULL
rz_list_free(bbs_list_b);
return NULL;
Expand Down
Loading