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

Fix some last coverities #10735

Merged
merged 5 commits into from Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion libr/asm/asm.c
Expand Up @@ -309,10 +309,12 @@ R_API int r_asm_use(RAsm *a, const char *name) {
r_list_foreach (a->plugins, iter, h) {
if (!strcmp (h->name, name) && h->arch) {
if (!a->cur || (a->cur && strcmp (a->cur->arch, h->arch))) {
char *file = r_str_newf ("%s/%s.sdb", r_str_r2_prefix (R2_SDB_OPCODES), h->arch);
char *r2prefix = r_str_r2_prefix (R2_SDB_OPCODES);
char *file = r_str_newf ("%s/%s.sdb", r_str_get (r2prefix), h->arch);
r_asm_set_cpu (a, NULL);
sdb_free (a->pair);
a->pair = sdb_new (NULL, file, 0);
free (r2prefix);
free (file);
}
a->cur = h;
Expand Down
2 changes: 1 addition & 1 deletion libr/bin/format/pe/pe.c
Expand Up @@ -2355,7 +2355,7 @@ static void _parse_resource_directory(struct PE_(r_bin_pe_obj_t) *bin, Pe_image_
break;
}
rs->timestr = _time_stamp_to_str (dir->TimeDateStamp);
rs->type = strdup (_resource_type_str (type));
rs->type = _resource_type_str (type);
rs->language = strdup (_resource_lang_str (entry.u1.Name & 0x3ff));
rs->data = data;
rs->name = id;
Expand Down
3 changes: 2 additions & 1 deletion libr/core/disasm.c
Expand Up @@ -1237,12 +1237,13 @@ static void ds_show_xrefs(RDisasmState *ds) {
}
ds_comment (ds, false, ")%s", COLOR_RESET (ds));
ds_newline (ds);
r_list_free (addrs);
r_list_purge (addrs);
R_FREE (name);
} else {
eprintf ("Corrupted database?\n");
}
}
r_list_free (addrs);
r_list_free (xrefs);
}

Expand Down
1 change: 0 additions & 1 deletion libr/core/graph.c
Expand Up @@ -2821,7 +2821,6 @@ static void agraph_print_edges(RAGraph *g) {
}

if (!a->is_dummy && itn == neighbours->head && out_nth == 0 && bx > ax) {
a_x_inc += 4;
ax += (many && !g->is_callgraph) ? 0 : 4;
}
if (a->h < a->layer_height) {
Expand Down