From 2e7fca9167c1d64257327f47403fd89f45870af6 Mon Sep 17 00:00:00 2001 From: Rafal Michalski Date: Fri, 8 Oct 2010 15:16:50 +0200 Subject: [PATCH] obexd: Fix memory leaks in phonebook-tracker 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. --- obexd/plugins/phonebook-tracker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c index c10491d9a..d0cea2e89 100644 --- a/obexd/plugins/phonebook-tracker.c +++ b/obexd/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 -- 2.47.3