]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix memory leak when outbound socket is closed by server
authorIco <ico.esl@gmail.com>
Tue, 25 Mar 2014 10:31:23 +0000 (12:31 +0200)
committerTravis Cross <tc@traviscross.com>
Wed, 26 Mar 2014 01:36:48 +0000 (01:36 +0000)
ESL-88 --resolve

Signed-off-by: Travis Cross <tc@traviscross.com>
libs/esl/src/esl_oop.cpp

index 9c202f21605f0524122ab967e4f366c9a5144a10..50ef90bbd45520535b941a0d930d5eefb64b4244 100644 (file)
@@ -50,10 +50,9 @@ ESLconnection::ESLconnection(int socket)
 
 ESLconnection::~ESLconnection()
 {
-       if (handle.connected) {
+       if (!handle.destroyed) {
                esl_disconnect(&handle);
        }
-
 }
 
 int ESLconnection::socketDescriptor()
@@ -68,7 +67,7 @@ int ESLconnection::socketDescriptor()
 
 int ESLconnection::disconnect()
 {
-       if (handle.connected) {
+       if (!handle.destroyed) {
         return esl_disconnect(&handle);
     }