Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git] / src / utils_vl_lookup.c
index 75c0206..f0f0b46 100644 (file)
@@ -304,9 +304,10 @@ static int lu_handle_user_class (lookup_t *obj, /* {{{ */
   {
     /* call lookup_class_callback_t() and insert into the list of user objects. */
     user_obj = lu_create_user_obj (obj, ds, vl, user_class);
-    pthread_mutex_unlock (&user_class->lock);
-    if (user_obj == NULL)
+    if (user_obj == NULL) {
+      pthread_mutex_unlock (&user_class->lock);
       return (-1);
+    }
   }
   pthread_mutex_unlock (&user_class->lock);