[PATCH obexd 1/4] client: Fix memory leak during session connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 client/session.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/session.c b/client/session.c
index a9883c7..0663262 100644
--- a/client/session.c
+++ b/client/session.c
@@ -407,8 +407,11 @@ static int session_connect(struct obc_session *session,
 	}
 
 	/* Ongoing connection */
-	if (session->id > 0)
+	if (session->id > 0) {
+		obc_session_unref(callback->session);
+		g_free(callback);
 		return 0;
+	}
 
 	session->id = transport->connect(session->source, session->destination,
 					driver->uuid, session->channel,
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux