diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-05-21 00:14:53 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-05-21 00:14:53 -0600 |
commit | 822d8a8fbfa99ba8340d0a3548c08244e2b203d6 (patch) | |
tree | 200539c81b848e4e709c6aa8c2be26cdaff19583 /libdimension/threads.c | |
parent | 6592197ee64e1a1d4f1c7db3573895ddce617571 (diff) | |
download | dimension-822d8a8fbfa99ba8340d0a3548c08244e2b203d6.tar.xz |
Fix memory handling in dmnsn_new_thread().
Diffstat (limited to 'libdimension/threads.c')
-rw-r--r-- | libdimension/threads.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libdimension/threads.c b/libdimension/threads.c index 5450ecc..3e117cd 100644 --- a/libdimension/threads.c +++ b/libdimension/threads.c @@ -39,9 +39,10 @@ dmnsn_thread(void *arg) dmnsn_thread_payload *payload = arg; int *ret; pthread_cleanup_push(&dmnsn_thread_cleanup, payload->progress); - ret = dmnsn_malloc(sizeof(ret)); + ret = dmnsn_malloc(sizeof(int)); *ret = (*payload->thread_fn)(payload->arg); pthread_cleanup_pop(1); + free(payload); return ret; } |