mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-28 16:53:36 +00:00
Delete temporary rarun2 profile when using r2 -X
This commit is contained in:
parent
6f1d8e161a
commit
835319ae8f
@ -708,15 +708,14 @@ int main(int argc, char **argv, char **envp) {
|
||||
return main_help (help > 1? 2: 0);
|
||||
}
|
||||
if (customRarunProfile) {
|
||||
char *tfn = r_file_temp (NULL);
|
||||
char *tfn = r_file_temp (".rarun2");
|
||||
if (!r_file_dump (tfn, (const ut8*)customRarunProfile, strlen (customRarunProfile), 0)) {
|
||||
eprintf ("Cannot create %s\n", tfn);
|
||||
} else {
|
||||
haveRarunProfile = true;
|
||||
r_config_set (r.config, "dbg.profile", tfn);
|
||||
}
|
||||
// TODO: must be removed or just dont use a temporary file
|
||||
// TODO this current code is leaking temporary files and memory
|
||||
free (tfn);
|
||||
}
|
||||
if (debug == 1) {
|
||||
if (optind >= argc && !haveRarunProfile) {
|
||||
|
@ -235,6 +235,9 @@ static RRunProfile* _get_run_profile(RIO *io, int bits, char **argv) {
|
||||
r_run_free (rp);
|
||||
return NULL;
|
||||
}
|
||||
if (strstr (io->runprofile, R_SYS_DIR ".rarun2.")) {
|
||||
(void)r_file_rm (io->runprofile);
|
||||
}
|
||||
}
|
||||
if (bits == 64) {
|
||||
r_run_parseline (rp, expr=strdup ("bits=64"));
|
||||
|
Loading…
Reference in New Issue
Block a user