public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] Fix more memory leaks in hcitool
@ 2009-02-15 19:47 Gustavo F. Padovan
  2009-02-15 19:47 ` [PATCH 2/6] hcitool: fix error message Gustavo F. Padovan
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo F. Padovan @ 2009-02-15 19:47 UTC (permalink / raw)
  To: linux-bluetooth

Free some mallocs.
---
 tools/hcitool.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/hcitool.c b/tools/hcitool.c
index faf4cb4..3ba9234 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -110,6 +110,7 @@ static int conn_list(int s, int dev_id, long arg)
 			addr, ci->handle, ci->state, str);
 		bt_free(str);
 	}
+	bt_free(cl);
 
 	return 0;
 }
@@ -134,9 +135,12 @@ static int find_conn(int s, int dev_id, long arg)
 	}
 
 	for (i = 0; i < cl->conn_num; i++, ci++)
-		if (!bacmp((bdaddr_t *) arg, &ci->bdaddr))
+		if (!bacmp((bdaddr_t *) arg, &ci->bdaddr)) {
+			bt_free(cl);
 			return 1;
+		}
 
+	bt_free(cl);
 	return 0;
 }
 
@@ -894,6 +898,7 @@ static void cmd_info(int dev_id, int argc, char **argv)
 		cc = 1;
 	} else
 		handle = htobs(cr->conn_info->handle);
+	bt_free(cr);
 
 	printf("\tBD Address:  %s\n", argv[0]);
 
-- 
1.6.0.6


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

end of thread, other threads:[~2009-02-16 12:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-15 19:47 [PATCH 1/6] Fix more memory leaks in hcitool Gustavo F. Padovan
2009-02-15 19:47 ` [PATCH 2/6] hcitool: fix error message Gustavo F. Padovan
2009-02-15 19:47   ` [PATCH 3/6] Change fprintf(stderr,...) to perror() Gustavo F. Padovan
2009-02-15 19:47     ` [PATCH 4/6] remove verification before free Gustavo F. Padovan
2009-02-15 19:47       ` [PATCH 5/6] Remove unnecessary attribution Gustavo F. Padovan
2009-02-15 19:47         ` [PATCH 6/6] Make expand_name a void function Gustavo F. Padovan
2009-02-16 12:21     ` [PATCH 3/6] Change fprintf(stderr,...) to perror() David Vrabel
2009-02-16 12:37       ` Gustavo F. Padovan

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