linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] storage: Fix memory leak
@ 2013-01-04  5:42 Jaganath Kanakkassery
  2013-01-04  5:42 ` [PATCH 2/2] rfkill: Fix count parameter in read Jaganath Kanakkassery
  2013-01-04 14:17 ` [PATCH 1/2] storage: Fix memory leak Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Jaganath Kanakkassery @ 2013-01-04  5:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jaganath Kanakkassery

If bt_uuid2string() returns NULL then svcclass has to be freed
---
 src/storage.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/storage.c b/src/storage.c
index 375974a..be3bbf2 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -180,8 +180,10 @@ sdp_record_t *find_record_in_list(sdp_list_t *recs, const char *uuid)
 
 		/* Extract the uuid */
 		uuid_str = bt_uuid2string(svcclass->data);
-		if (!uuid_str)
+		if (!uuid_str) {
+			sdp_list_free(svcclass, free);
 			continue;
+		}
 
 		if (!strcasecmp(uuid_str, uuid)) {
 			sdp_list_free(svcclass, free);
-- 
1.7.9.5


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

end of thread, other threads:[~2013-01-04 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-04  5:42 [PATCH 1/2] storage: Fix memory leak Jaganath Kanakkassery
2013-01-04  5:42 ` [PATCH 2/2] rfkill: Fix count parameter in read Jaganath Kanakkassery
2013-01-04 14:17 ` [PATCH 1/2] storage: Fix memory leak Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).