From fd3868ebc7bebe34afa3fced392686bb1a949da8 Mon Sep 17 00:00:00 2001 From: Syam Sidhardhan Date: Thu, 6 Jul 2017 21:38:15 +0530 Subject: [PATCH] obexd: Fix memory leak in phonebook-dummy g_build_filename() returns a newly-allocated string that must be freed with g_free(). --- obexd/plugins/phonebook-dummy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/obexd/plugins/phonebook-dummy.c b/obexd/plugins/phonebook-dummy.c index 29ae8893c..b9e3a0d23 100644 --- a/obexd/plugins/phonebook-dummy.c +++ b/obexd/plugins/phonebook-dummy.c @@ -524,6 +524,9 @@ void *phonebook_get_entry(const char *folder, const char *id, filename = g_build_filename(root_folder, folder, id, NULL); fd = open(filename, O_RDONLY); + + g_free(filename); + if (fd < 0) { DBG("open(): %s(%d)", strerror(errno), errno); if (err) -- 2.47.3