]> git.pond.sub.org Git - empserver/commitdiff
(empth_exit, empth_rwlock_destroy): Plug memory leaks.
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 Jan 2007 16:59:15 +0000 (16:59 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 Jan 2007 16:59:15 +0000 (16:59 +0000)
src/lib/empthread/pthread.c

index 307a88defb04dbda0e386870d5473d0b66e366e0..b0e8dc727c2da960dfc6b78bdeba7874e7d4ab12 100644 (file)
@@ -264,9 +264,12 @@ empth_self(void)
 void
 empth_exit(void)
 {
+    empth_t *ctx = pthread_getspecific(ctx_key);
+
     empth_status("empth_exit");
     pthread_mutex_unlock(&mtx_ctxsw);
-    free(pthread_getspecific(ctx_key));
+    free(ctx->name);
+    free(ctx);
     pthread_exit(0);
 }
 
@@ -479,6 +482,7 @@ void
 empth_rwlock_destroy(empth_rwlock_t *rwlock)
 {
     pthread_rwlock_destroy(&rwlock->lock);
+    free(rwlock->name);
     free(rwlock);
 }