diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/malloc_wrapper.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ef1fbab..873b943 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + * miscfuncs.cc (__import_address): Check if malloc field points + directly at 'malloc'. + +2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + * miscfuncs.cc (__import_address): On second thought, the chance that this pointer could be NULL is very low so don't bother checking for it. diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc index c514af3..2adacba 100644 --- a/winsup/cygwin/malloc_wrapper.cc +++ b/winsup/cygwin/malloc_wrapper.cc @@ -286,7 +286,8 @@ malloc_init () extern void *_sigfe_malloc; /* Decide if we are using our own version of malloc by testing the import address from user_data. */ - use_internal = import_address (user_data->malloc) == &_sigfe_malloc; + use_internal = user_data->malloc == malloc + || import_address (user_data->malloc) == &_sigfe_malloc; malloc_printf ("using %s malloc", use_internal ? "internal" : "external"); internal_malloc_determined = true; } |