[gvfs] Fix leak



commit 7d3f27bf9a94aef335a591bfdc927beacb0bd7a9
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Sep 8 09:32:18 2009 +0200

    Fix leak
    
    Need to free /proc/fd/mountinfo contents after reading it.

 metadata/metatree.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/metadata/metatree.c b/metadata/metatree.c
index d587b71..21c6968 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -3002,7 +3002,10 @@ update_mountinfo (void)
   contents = read_contents (mountinfo_fd);
   lseek (mountinfo_fd, SEEK_SET, 0);
   if (contents)
-    mountinfo_roots = parse_mountinfo (contents);
+    {
+      mountinfo_roots = parse_mountinfo (contents);
+      g_free (contents);
+    }
 }
 
 static char *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]