frontend_net: fix memory leak
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 18 Mar 2014 14:01:07 +0000 (15:01 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 18 Mar 2014 14:01:07 +0000 (15:01 +0100)
This leak would occur if all sessions were in use and the input
queue was cleared when a client would close connection (socket).

src/thread_pool_observer.cpp

index 8353f5b..a52cd92 100644 (file)
@@ -220,7 +220,10 @@ void ThreadPoolSocketObserver::cleanup(IThreadPoolMsg *m, void *info)
     while (it != m_p->m_input.end())
     {
         if ((*it)->cleanup(info))
+        {
+            delete *it;
             it = m_p->m_input.erase(it);
+        }
         else
             it++;
     }