Fix multiple aeim calls

This commit is contained in:
pancake 2017-08-27 00:59:57 +02:00
parent d4ee6f6e95
commit 6a36a33423
3 changed files with 4 additions and 3 deletions

View File

@ -3227,7 +3227,8 @@ static void cmd_esil_mem(RCore *core, const char *input) {
if (!*input) {
RFlagItem *fi = r_flag_get (core->flags, "aeim.fd");
if (fi) {
r_core_cmdf (core, "o-%d", fi->offset);
// Close the fd associated with the aeim stack
(void)r_io_fd_close (core->io, fi->offset);
}
}
addr = r_config_get_i (core->config, "esil.stack.addr");

View File

@ -1010,7 +1010,7 @@ static int cmd_open(void *data, const char *input) {
}
}
break;
case 0:
case 0:
case '?':
eprintf ("Usage: o-# or o-*, where # is the filedescriptor number\n");
}

View File

@ -872,7 +872,6 @@ R_API int r_core_file_close(RCore *r, RCoreFile *fh) {
r_core_bin_set_by_fd (r, fh->fd);
/* delete filedescriptor from io descs here */
r_io_desc_close (desc);
// r_io_desc_del (r->io, fh->fd);
// AVOID DOUBLE FREE HERE
@ -892,6 +891,7 @@ R_API int r_core_file_close(RCore *r, RCoreFile *fh) {
ret = r_core_file_set_by_file (r, prev_cf);
}
}
r_io_desc_close (desc);
return ret;
}