[glib] glocalfile: Fix memory leak in find_topdir_for()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] glocalfile: Fix memory leak in find_topdir_for()
- Date: Sat, 3 Oct 2015 09:49:18 +0000 (UTC)
commit 9275be383f63441e45ead925c8956b2d1a7768b1
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sat Oct 3 10:48:46 2015 +0100
glocalfile: Fix memory leak in find_topdir_for()
Coverity CID 1325398.
gio/glocalfile.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index 60b9560..45023a3 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -1705,13 +1705,17 @@ static char *
find_topdir_for (const char *file)
{
char *dir;
+ char *mountpoint = NULL;
dev_t dir_dev;
dir = get_parent (file, &dir_dev);
if (dir == NULL)
return NULL;
- return find_mountpoint_for (dir, dir_dev);
+ mountpoint = find_mountpoint_for (dir, dir_dev);
+ g_free (dir);
+
+ return mountpoint;
}
static char *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]