Valgrind is a very good tool for debugging memory leak issues. It reported 3k bytes of leak for every connection that was made to the server. The mailing list gave hints to the solution. After about ten days of analysis and help from top-notch developer in team it turned that I was using an OpenSSL API incorrectly. The fix turned out to be calling a different method than what I was using.
The application crash problem was tougher. It couldn't make it to the targeted release of the product. The crash was occurring when the application was heavily stressed. The mailing list was of not much help. After days of investigation it turned out that the bug was in the OpenSSL code. The OpenSSL method of getting thread IDs was failing in the Linux kernel 2.6. The implementation returned the same ID for every thread. As such the stack was to be changed to fix the issue. And even this time the fix is just a change in one line of the code. Here too I should be thanking my friend who helped me in having the issue fixed and the product released. It helps in having a high quality developer in the team as very good friend of yours!



