mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-26 09:06:02 +00:00
Fix some memory leaks spotted by coverity
This commit is contained in:
parent
f55a2bfe6e
commit
bc25b92a28
@ -1843,7 +1843,7 @@ static int cmd_open(void *data, const char *input) {
|
||||
}
|
||||
return 0;
|
||||
case 't': // "ot"
|
||||
r_core_cmd_strf (core, "touch%s", input + 1);
|
||||
r_core_cmdf (core, "touch%s", input + 1);
|
||||
return 0;
|
||||
case 'p': // "op"
|
||||
/* handle prioritize */
|
||||
|
@ -1367,6 +1367,7 @@ static void cmd_print_fromage(RCore *core, const char *input, const ut8* data, i
|
||||
char *oid = r_asn1_oid (a);
|
||||
if (oid) {
|
||||
r_cons_printf ("%s\n", oid);
|
||||
free (oid);
|
||||
}
|
||||
r_asn1_free (a);
|
||||
}
|
||||
|
@ -243,6 +243,7 @@ static void rarch2_list(RAsmState *as, const char *arch) {
|
||||
pj_end (pj);
|
||||
printf ("%s\n", pj_string (pj));
|
||||
}
|
||||
pj_free (pj);
|
||||
}
|
||||
|
||||
static void ranal2_list(RAsmState *as, const char *arch) {
|
||||
|
@ -313,13 +313,13 @@ static RASN1String* asn1_hexdump(RASN1Object *obj, ut32 depth, int fmtmode) {
|
||||
// XXX this function signature is confusing
|
||||
R_API char *r_asn1_object_tostring(RASN1Object *obj, ut32 depth, RStrBuf *sb, PJ *pj, int fmtmode) {
|
||||
bool root = false;
|
||||
if (!obj) {
|
||||
return NULL;
|
||||
}
|
||||
if (!sb) {
|
||||
sb = r_strbuf_new ("");
|
||||
root = true;
|
||||
}
|
||||
if (!obj) {
|
||||
return NULL;
|
||||
}
|
||||
char temp_name[4096] = {0};
|
||||
ut32 i;
|
||||
// this shall not be freed. it's a pointer into the buffer.
|
||||
|
Loading…
x
Reference in New Issue
Block a user