Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Fix small memleak in compat/pand.c
@ 2011-03-04 18:32 Szymon Janc
  2011-03-04 18:57 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2011-03-04 18:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: par-gunnar.p.hjalmdahl, henrik.possung, Szymon Janc

---
 compat/pand.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/compat/pand.c b/compat/pand.c
index c3860fa..b82650e 100644
--- a/compat/pand.c
+++ b/compat/pand.c
@@ -456,10 +456,13 @@ static void do_show(void)
 
 static void do_kill(char *dst)
 {
-	if (dst)
-		bnep_kill_connection((void *) strtoba(dst));
-	else
+	if (dst) {
+		bdaddr_t *ba = strtoba(dst);
+		bnep_kill_connection((void *) ba);
+		free(ba);
+	} else {
 		bnep_kill_all_connections();
+	}
 }
 
 static void sig_hup(int sig)
-- 
1.7.0.4
on behalf of ST-Ericsson

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-04 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 18:32 [PATCH] Fix small memleak in compat/pand.c Szymon Janc
2011-03-04 18:57 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox