[tracker/o_noatime] Fix memory leak (squash)



commit e0eda87ab541600ef07d0d5978da9fbfbe5973f2
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Sep 22 14:23:31 2011 +0200

    Fix memory leak (squash)

 src/tracker-extract/tracker-extract-text.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-text.c b/src/tracker-extract/tracker-extract-text.c
index f6572d7..a63ed04 100644
--- a/src/tracker-extract/tracker-extract-text.c
+++ b/src/tracker-extract/tracker-extract-text.c
@@ -59,6 +59,8 @@ get_file_content (GFile *file,
 	}
 
 	uri = g_file_get_uri (file);
+
+	/* Get filename from URI */
 	path = g_file_get_path (file);
 
 	fd = g_open (path, O_RDONLY | O_NOATIME, 0);
@@ -69,10 +71,10 @@ get_file_content (GFile *file,
 		           error->message);
 		g_error_free (error);
 		g_free (uri);
+		g_free (path);
 		return NULL;
 	}
 
-	/* Get filename from URI */
 	stream = g_unix_input_stream_new (fd, FALSE);
 
 	g_debug ("  Starting to read '%s' up to %" G_GSIZE_FORMAT " bytes...",
@@ -86,6 +88,7 @@ get_file_content (GFile *file,
 	g_object_unref (stream);
 	close (fd);
 	g_free (uri);
+	g_free (path);
 
 	return text;
 }



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