Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-08-21 12:47:59 +0400
committerCorinna Vinschen <corinna@vinschen.de>2009-08-21 12:47:59 +0400
commita2c5f4b4e47813022a63a68dcbcdb3964d5839a9 (patch)
tree9259a9c24ef3eff9f5d87146c8cca790e0d136bb
parent5d38c0d9069efb0e978084e6ff66bfa118f6ed51 (diff)
* mmap.cc (mmap64): Allocate fh_disk_file on cygheap. Delete
explicitely before returning.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/mmap.cc8
2 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 3d16bbe3b..9c08c56da 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (mmap64): Allocate fh_disk_file on cygheap. Delete
+ explicitely before returning.
+
2009-08-20 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (build_fh_dev): Take additional bool parameter indicating
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;