From: Ico Date: Tue, 25 Mar 2014 10:31:23 +0000 (+0200) Subject: Fix memory leak when outbound socket is closed by server X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73790b4f0d8d7821e784eef26a0e8bbdb303df92;p=thirdparty%2Ffreeswitch.git Fix memory leak when outbound socket is closed by server ESL-88 --resolve Signed-off-by: Travis Cross --- diff --git a/libs/esl/src/esl_oop.cpp b/libs/esl/src/esl_oop.cpp index 9c202f2160..50ef90bbd4 100644 --- a/libs/esl/src/esl_oop.cpp +++ b/libs/esl/src/esl_oop.cpp @@ -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); }