diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-08-21 12:47:59 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-08-21 12:47:59 +0400 |
commit | a2c5f4b4e47813022a63a68dcbcdb3964d5839a9 (patch) | |
tree | 9259a9c24ef3eff9f5d87146c8cca790e0d136bb /winsup/cygwin/mmap.cc | |
parent | 5d38c0d9069efb0e978084e6ff66bfa118f6ed51 (diff) |
* mmap.cc (mmap64): Allocate fh_disk_file on cygheap. Delete
explicitely before returning.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r-- | winsup/cygwin/mmap.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 94dee5e4d..6be40a1b3 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -849,7 +849,8 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off) | FILE_OPEN_FOR_BACKUP_INTENT); if (NT_SUCCESS (status)) { - fh_disk_file = new (alloca (sizeof *fh_disk_file)) fhandler_disk_file; + fh_disk_file = new (ccalloc (HEAP_FHANDLER, 1, sizeof *fh_disk_file)) + fhandler_disk_file; fh_disk_file->set_name (fh->pc); fh_disk_file->set_io_handle (h); fh_disk_file->set_access (fh->get_access () | GENERIC_EXECUTE); @@ -1042,7 +1043,10 @@ out_with_unlock: out: if (fh_disk_file) - NtClose (fh_disk_file->get_handle ()); + { + NtClose (fh_disk_file->get_handle ()); + delete fh; + } syscall_printf ("%p = mmap() ", ret); return ret; |