mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 05:09:43 +00:00
Fix few memleaks spotted by coverity scan
This commit is contained in:
parent
7ffeaaebfe
commit
0e30faff28
@ -1426,6 +1426,7 @@ static void cmd_id(RCore *core, PJ *pj, const char *input, int is_array, int mod
|
||||
char* dir = r_file_dirname (core->bin->cur->file);
|
||||
filename = r_str_newf ("%s/%s", dir, basename);
|
||||
file_found = r_file_exists (filename);
|
||||
free (dir);
|
||||
} else {
|
||||
filename = strdup (basename);
|
||||
}
|
||||
@ -1439,9 +1440,10 @@ static void cmd_id(RCore *core, PJ *pj, const char *input, int is_array, int mod
|
||||
symstore_path, base_file, info->guid, base_file);
|
||||
file_found = r_file_exists (pdb_path);
|
||||
if (file_found) {
|
||||
free (filename);
|
||||
filename = pdb_path;
|
||||
} else {
|
||||
R_FREE (pdb_path);
|
||||
free (pdb_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
static char *getFortuneFile(RCore *core, const char *type) {
|
||||
r_strf_var (fname, 64, "fortunes.%s", type);
|
||||
char *fortunedir = r_xdg_datadir ("fortunes");
|
||||
char *path = path = r_file_new (fortunedir, fname, NULL);
|
||||
char *path = r_file_new (fortunedir, fname, NULL);
|
||||
free (fortunedir);
|
||||
if (path && r_file_exists (path)) {
|
||||
return path;
|
||||
|
Loading…
Reference in New Issue
Block a user