Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Reduction memory leaks in phonebook module
@ 2010-10-08 14:00 Rafał Michalski
  2010-10-09 15:26 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Rafał Michalski @ 2010-10-08 14:00 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-Reduction-memory-leaks-in-phonebook-module.patch --]
[-- Type: text/x-patch, Size: 965 bytes --]

From 40399b62ec62569213948f7eb77fd39d1ff42ea1 Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Fri, 8 Oct 2010 15:16:50 +0200
Subject: [PATCH] Reduction memory leaks in phonebook module

Memory, pointed by pointers home_addr and work_addr, is allocated
temporarily and not freed. Only duplicates of this memory (made after
invoking add_address function) are freed later.
---
 plugins/phonebook-tracker.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index c10491d..d0cea2e 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -1007,6 +1007,9 @@ add_numbers:
 	add_address(contact, home_addr, ADDR_TYPE_HOME);
 	add_address(contact, work_addr, ADDR_TYPE_WORK);
 
+	g_free(home_addr);
+	g_free(work_addr);
+
 	DBG("contact %p", contact);
 
 	/* Adding contacts data to wrapper struct - this data will be used to
-- 
1.6.3.3


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

end of thread, other threads:[~2010-10-09 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08 14:00 [PATCH] Reduction memory leaks in phonebook module Rafał Michalski
2010-10-09 15:26 ` Johan Hedberg

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