Fix all the covs (memleaks) reported the 15th of this month (#17163)

This commit is contained in:
pancake 2020-06-29 09:40:35 +02:00 committed by GitHub
parent ad20ed47bd
commit f061b49c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,9 @@ static int assemble(RAsm *a, RAsmOp *op, const char *buf) {
(void)close (ifd);
free (asm_buf);
if (!success) {
free (as);
free (ipath);
free (opath);
return -1;
}
}

View File

@ -3459,6 +3459,7 @@ R_API char *r_core_editor(const RCore *core, const char *file, const char *str)
const size_t str_len = strlen (str);
if (write (fd, str, str_len) != str_len) {
close (fd);
free (name);
return NULL;
}
}

View File

@ -408,6 +408,7 @@ R_API int r_main_radare2(int argc, const char **argv) {
r = r_core_new ();
if (!r) {
eprintf ("Cannot initialize RCore\n");
LISTS_FREE ();
return 1;
}
r->r_main_radare2 = r_main_radare2;