[tracker/tracker-0.10] libtracker-extract: free of a pointer that got offset by strchr



commit 8673cad3d13f5fcf7d5ac913bcfdeef87923729f
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Mar 17 14:15:13 2011 +0100

    libtracker-extract: free of a pointer that got offset by strchr
    
    Fixes NB#237582.

 src/libtracker-extract/tracker-utils.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-utils.c b/src/libtracker-extract/tracker-utils.c
index b4f38a1..887adac 100644
--- a/src/libtracker-extract/tracker-utils.c
+++ b/src/libtracker-extract/tracker-utils.c
@@ -982,10 +982,11 @@ void
 tracker_keywords_parse (GPtrArray   *store,
                         const gchar *keywords)
 {
-	gchar *keywords_d = g_strdup (keywords);
+	gchar *orig, *keywords_d;
 	char *saveptr, *p;
 	size_t len;
 
+	keywords_d = orig = g_strdup (keywords);
 	p = keywords_d;
 	keywords_d = strchr (keywords_d, '"');
 
@@ -1029,5 +1030,5 @@ tracker_keywords_parse (GPtrArray   *store,
 		g_free (p_do);
 	}
 
-	g_free (keywords_d);
+	g_free (orig);
 }



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