diff options
author | Martin Willi <martin@strongswan.org> | 2006-04-27 11:38:24 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-04-27 11:38:24 +0000 |
commit | eea353466ec86ad5fd3fc4fb7ac560ebced64f3d (patch) | |
tree | aa0908775b34dbce4b98526c1cfce7fd82a34074 /Source/lib/utils/leak_detective.c | |
parent | f1e87b9022fa68ea4cc38317eea1a59a41a5ae3d (diff) | |
download | strongswan-eea353466ec86ad5fd3fc4fb7ac560ebced64f3d.tar.bz2 strongswan-eea353466ec86ad5fd3fc4fb7ac560ebced64f3d.tar.xz |
- reworked usage of IDs in various states
- using ID_ANY for any, not NULL as before
- initiator sends IDr payload in IKE_AUTH when ID unique
Diffstat (limited to 'Source/lib/utils/leak_detective.c')
-rw-r--r-- | Source/lib/utils/leak_detective.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/Source/lib/utils/leak_detective.c b/Source/lib/utils/leak_detective.c index a6a5c9a91..780ba4c05 100644 --- a/Source/lib/utils/leak_detective.c +++ b/Source/lib/utils/leak_detective.c @@ -253,7 +253,7 @@ void free_hook(void *ptr, const void *caller) { pthread_mutex_unlock(&mutex); /* TODO: since pthread_join cannot be excluded cleanly, we are not whining about bad frees */ - //return; + return; logger->log(logger, ERROR, "freeing of invalid memory (%p)", ptr); stack_frame_count = backtrace(stack_frames, STACK_FRAMES_COUNT); log_stack_frames(stack_frames, stack_frame_count); @@ -404,41 +404,41 @@ char *inet_ntoa(struct in_addr in) return result; } -// int pthread_create(pthread_t *__restrict __threadp, __const pthread_attr_t *__restrict __attr, -// void *(*__start_routine) (void *), void *__restrict __arg) -// { -// int (*_pthread_create) (pthread_t *__restrict __threadp, -// __const pthread_attr_t *__restrict __attr, -// void *(*__start_routine) (void *), -// void *__restrict __arg) = excluded_functions[PTHREAD_CREATE].lib_function; -// int result; -// -// pthread_mutex_lock(&mutex); -// uninstall_hooks(); -// -// result = _pthread_create(__threadp, __attr, __start_routine, __arg); -// -// install_hooks(); -// pthread_mutex_unlock(&mutex); -// return result; -// } -// -// -// int pthread_cancel(pthread_t __th) -// { -// int (*_pthread_cancel) (pthread_t) = excluded_functions[PTHREAD_CANCEL].lib_function; -// int result; -// -// pthread_mutex_lock(&mutex); -// uninstall_hooks(); -// -// result = _pthread_cancel(__th); -// -// install_hooks(); -// pthread_mutex_unlock(&mutex); -// return result; -// } -// +int pthread_create(pthread_t *__restrict __threadp, __const pthread_attr_t *__restrict __attr, + void *(*__start_routine) (void *), void *__restrict __arg) +{ + int (*_pthread_create) (pthread_t *__restrict __threadp, + __const pthread_attr_t *__restrict __attr, + void *(*__start_routine) (void *), + void *__restrict __arg) = excluded_functions[PTHREAD_CREATE].lib_function; + int result; + + pthread_mutex_lock(&mutex); + uninstall_hooks(); + + result = _pthread_create(__threadp, __attr, __start_routine, __arg); + + install_hooks(); + pthread_mutex_unlock(&mutex); + return result; +} + + +int pthread_cancel(pthread_t __th) +{ + int (*_pthread_cancel) (pthread_t) = excluded_functions[PTHREAD_CANCEL].lib_function; + int result; + + pthread_mutex_lock(&mutex); + uninstall_hooks(); + + result = _pthread_cancel(__th); + + install_hooks(); + pthread_mutex_unlock(&mutex); + return result; +} + // /* TODO: join has probs, since it dellocates memory // * allocated (somewhere) with leak_detective :-(. // * We should exclude all pthread_ functions to fix it !? */ |