Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git] / src / utils_vl_lookup.c
index 8180d0d..f0f0b46 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/utils_vl_lookup.c
- * Copyright (C) 2012  Florian Forster
+ * Copyright (C) 2012       Florian Forster
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -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);