]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api idnode: fix mutex lock/unlock in api_idnode_handler
authorJaroslav Kysela <perex@perex.cz>
Thu, 5 May 2016 06:40:16 +0000 (08:40 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 5 May 2016 06:41:08 +0000 (08:41 +0200)
src/api/api_idnode.c

index 7883bf5089d38104eea6caef6682678891f8bf23..fa9edb3ecd28bc04c6c4b6cb420ed9b943104e7d 100644 (file)
@@ -628,8 +628,6 @@ api_idnode_handler
     if (!(uuid = htsmsg_field_get_str(f)))
       return EINVAL;
 
-  pthread_mutex_lock(&global_lock);
-
   /* Multiple */
   if (uuids) {
     const idnodes_rb_t *domain = NULL;
@@ -642,6 +640,7 @@ api_idnode_handler
       if ((in = idnode_find(uuid, NULL, domain)) != NULL) {
         domain = in->in_domain;
         if (idnode_perm(in, perm, msg)) {
+          pthread_mutex_unlock(&global_lock);
           pcnt++;
           continue;
         }