Coverifix++

This commit is contained in:
jvoisin 2015-01-16 00:56:54 +01:00
parent abd2fb5179
commit ce9ece1177
8 changed files with 14 additions and 7 deletions

View File

@ -124,8 +124,10 @@ static RList *symbols(RBinFile *arch) {
if (!(ptr = R_NEW0 (RBinSymbol)))
break;
coffname = r_coff_symbol_name (obj, &obj->symbols[i]);
if (!coffname)
if (!coffname) {
free (ptr);
break;
}
strncpy (ptr->name, coffname, R_BIN_SIZEOF_STRINGS);
strncpy (ptr->forwarder, "NONE", R_BIN_SIZEOF_STRINGS);

View File

@ -764,6 +764,7 @@ R_API void r_cons_highlight (const char *word) {
I.buffer = res;
I.buffer_len = I.buffer_sz = strlen (res);
}
free (rword);
} else {
free (I.highlight);
I.highlight = NULL;

View File

@ -176,10 +176,9 @@ static int bin_strings (RCore *r, int mode, ut64 baddr, int va) {
ut64 vaddr = r_bin_get_vaddr (bin, baddr,
string->vaddr, string->paddr);
ut64 paddr = string->paddr;
q = strdup (string->string);
if (maxstr && string->length>maxstr) {
if (maxstr && string->length>maxstr)
continue;
}
q = strdup (string->string);
for (p=q; *p; p++) {
if (*p=='"') *p = '\'';
if (*p=='\\') *p = '/';

View File

@ -1720,11 +1720,11 @@ static boolt cmd_anal_refs(RCore *core, const char *input) {
core->cons->pal.num);
r_cons_printf ("%c 0x%"PFMT64x" %s\n",
ref->type, ref->at, buf_asm);
free (buf_asm);
}
}
r_list_free (list);
}
free (buf_asm);
}
break;
case 'F':

View File

@ -272,6 +272,7 @@ static void cmd_print_format (RCore *core, const char *_input, int len) {
}
r_list_free (files);
}
free (input);
return;
}
/* syntax aliasing bridge for 'pf foo=xxd' -> 'pf.foo xxd' */

View File

@ -821,6 +821,7 @@ static int r_core_search_rop(RCore *core, ut64 from, ut64 to, int opt, const cha
r_list_free (rx_list);
r_list_free (end_list);
r_list_free (badstart);
r_list_free (list);
return R_FALSE;
}
}
@ -831,6 +832,7 @@ static int r_core_search_rop(RCore *core, ut64 from, ut64 to, int opt, const cha
r_list_free (rx_list);
r_list_free (end_list);
r_list_free (badstart);
r_list_free (list);
return -1;
}
r_io_read_at (core->io, from, buf, delta);

View File

@ -2508,8 +2508,8 @@ R_API int r_core_print_disasm_json(RCore *core, ut64 addr, ut8 *buf, int nb_byte
r_anal_xrefs_type_tostring (ref->type));
}
r_cons_printf ("]");
r_list_free (xrefs);
}
r_list_free (xrefs);
}
r_cons_printf ("}");

View File

@ -141,8 +141,10 @@ R_API RSearchKeyword *r_search_keyword_new_regexp (const char *str, const char *
return NULL;
kw->bin_keyword = malloc (length+1);
if (!kw->bin_keyword)
if (!kw->bin_keyword) {
free (kw);
return NULL;
}
kw->bin_keyword[length]=0;
memcpy(kw->bin_keyword, str + start, length);