Fix some memory leaks spotted by coverity

This commit is contained in:
pancake 2022-11-11 18:56:51 +01:00 committed by pancake
parent f55a2bfe6e
commit bc25b92a28
4 changed files with 6 additions and 4 deletions

View File

@ -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 */

View File

@ -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);
}

View File

@ -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) {

View File

@ -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.