Simplify http_server_destroy
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 23 Mar 2010 14:33:43 +0000 (15:33 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 23 Mar 2010 14:33:43 +0000 (15:33 +0100)
src/http.c

index 60d8e30..8321bb3 100644 (file)
@@ -1374,14 +1374,9 @@ void http_server_destroy(http_server_t hs)
     {
         int r;
 
-        if (hs->mutex)
-        {
-            yaz_mutex_enter(hs->mutex);
-            r = --(hs->ref_count);
-            yaz_mutex_leave(hs->mutex);
-        }
-        else
-            r = --(hs->ref_count);
+        yaz_mutex_enter(hs->mutex); /* OK: hs->mutex may be NULL */
+        r = --(hs->ref_count);
+        yaz_mutex_leave(hs->mutex);
 
         if (r == 0)
         {