From 16dbedf2b066017ac5ac37db05f5281d26b2e8c6 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 3 Oct 2013 11:25:42 +0200 Subject: [PATCH] Fix SEGV when reaching max-clients YPRX-20 --- src/yaz-proxy.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 943281c..266af40 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -803,18 +803,14 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu, const char *cookie, return c; } } - else - { - - yaz_log(YLOG_LOG, "%sNEW %d %s", - m_session_str, parent->m_seqno, m_proxyTarget); - c = new Yaz_ProxyClient(m_PDU_Observable->clone(), parent); - c->m_next = parent->m_clientPool; - if (c->m_next) - c->m_next->m_prev = &c->m_next; - parent->m_clientPool = c; - c->m_prev = &parent->m_clientPool; - } + yaz_log(YLOG_LOG, "%sNEW %d %s", + m_session_str, parent->m_seqno, m_proxyTarget); + c = new Yaz_ProxyClient(m_PDU_Observable->clone(), parent); + c->m_next = parent->m_clientPool; + if (c->m_next) + c->m_next->m_prev = &c->m_next; + parent->m_clientPool = c; + c->m_prev = &parent->m_clientPool; xfree(c->m_cookie); c->m_cookie = 0; -- 1.7.10.4