]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Use sem_del() to destroy semaphores.
authorSimon Ruderich <simon@ruderich.org>
Sun, 28 Jul 2013 12:25:06 +0000 (14:25 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 28 Jul 2013 12:25:06 +0000 (14:25 +0200)
free() only works by accident and doesn't free the mutexes/condition
variables.

src/tlsproxy.c

index 0eefaa3e22ddae4bf9ff799b9ba857a16bd3b04e..7c4f1da2d122e2d693812ade6f4796082ce79e3a 100644 (file)
@@ -223,9 +223,9 @@ int main(int argc, char **argv) {
         }
     }
 
-    free(ringbuffer_full);
-    free(ringbuffer_free);
-    free(ringbuffer_lock);
+    sem_del(ringbuffer_full);
+    sem_del(ringbuffer_free);
+    sem_del(ringbuffer_lock);
 
     free(threads);