--- ./haproxy.c~ Sat Nov 27 16:49:09 2004 +++ ./haproxy.c Sat Nov 27 17:04:42 2004 @@ -5391,8 +5391,14 @@ Alert("parsing [%s:%d] : out of memory.\n", file, linenum); return -1; } - newsrv->next = curproxy->srv; - curproxy->srv = newsrv; + + if (curproxy->srv == NULL) + curproxy->srv = newsrv; + else + curproxy->cursrv->next = newsrv; + curproxy->cursrv = newsrv; + + newsrv->next = NULL; newsrv->proxy = curproxy; do_check = 0; @@ -6151,6 +6157,7 @@ } while (curproxy != NULL) { + curproxy->cursrv = NULL; if (curproxy->state == PR_STDISABLED) { curproxy = curproxy->next; continue;