]> granicus.if.org Git - apache/commitdiff
Arrange the slotmem chain logic.
authorJean-Frederic Clere <jfclere@apache.org>
Mon, 6 Jul 2009 08:39:44 +0000 (08:39 +0000)
committerJean-Frederic Clere <jfclere@apache.org>
Mon, 6 Jul 2009 08:39:44 +0000 (08:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@791409 13f79535-47bb-0310-9956-ffa450edef68

modules/slotmem/mod_slotmem_shm.c

index dee8bc6c1cb6eadf1e8f45226f03557d8c8814f1..3b5f326614339cd5f5caf894c3651c20cf3068c5 100644 (file)
@@ -251,13 +251,18 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new,
         }
 
         /* first try to attach to existing slotmem */
-        while (next) {
-            if (strcmp(next->name, fname) == 0) {
-                /* we already have it */
-                *new = next;
-                return APR_SUCCESS;
+        if (next) {
+            for (;;) {
+                if (strcmp(next->name, fname) == 0) {
+                    /* we already have it */
+                    *new = next;
+                    return APR_SUCCESS;
+                }
+                if (!next->next) {
+                     break;
+                }
+                next = next->next;
             }
-            next = next->next;
         }
     }
     else {