From: Jean-Frederic Clere Date: Mon, 6 Jul 2009 08:39:44 +0000 (+0000) Subject: Arrange the slotmem chain logic. X-Git-Tag: 2.3.3~475 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1b75791040d9feb4016b988c65e9d62a24fe09b;p=apache Arrange the slotmem chain logic. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@791409 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index dee8bc6c1c..3b5f326614 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -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 {