summaryrefslogtreecommitdiffstats
path: root/libdimension/threads.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-21 00:14:53 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-21 00:14:53 -0600
commit822d8a8fbfa99ba8340d0a3548c08244e2b203d6 (patch)
tree200539c81b848e4e709c6aa8c2be26cdaff19583 /libdimension/threads.c
parent6592197ee64e1a1d4f1c7db3573895ddce617571 (diff)
downloaddimension-822d8a8fbfa99ba8340d0a3548c08244e2b203d6.tar.xz
Fix memory handling in dmnsn_new_thread().
Diffstat (limited to 'libdimension/threads.c')
-rw-r--r--libdimension/threads.c3
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;
}