This is r791409 from mod_slotmem_shm.c applied to mod_slotmem_plain.c
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1001755 13f79535-47bb-0310-9956-
ffa450edef68
fname = ap_server_root_relative(pool, name);
/* 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