perl: unlock mutex on error
[collectd.git] / src / perl.c
index d42afc2..d247dc0 100644 (file)
@@ -1202,7 +1202,10 @@ static void c_ithread_destructor (void *arg)
 
        /* the ithread no longer exists */
        if (NULL == t)
+       {
+               pthread_mutex_unlock (&perl_threads->mutex);
                return;
+       }
 
        c_ithread_destroy (ithread);