BUGFIX missing unlocks
diff --git a/src/netopeerguid.c b/src/netopeerguid.c
index 4bfef9f..34f6b35 100644
--- a/src/netopeerguid.c
+++ b/src/netopeerguid.c
@@ -1263,6 +1263,7 @@
          locked_session = locked_session->next);
 
     if (!locked_session) {
+        pthread_rwlock_unlock(&session_lock);
         ERROR("Could not find the session %u to close.", session_key);
         (*reply) = create_error_reply("Internal: Error while finding a session.");
         return EXIT_FAILURE;
@@ -3359,6 +3360,7 @@
             } else {
                 pthread_mutex_lock(&json_lock);
                 if (json_object_object_get_ex(request, "sessions", &sessions) == FALSE) {
+                    pthread_mutex_unlock(&json_lock);
                     add_reply(replies, create_error_reply("Operation missing \"sessions\" arg"), 0);
                     goto send_reply;
                 }