[tracker] Fixes NB#613114, Date string is leaked in MSOffice extractor



commit c1de1ab682daaa391b88ff690cab8e1087b2d4a7
Author: Amit Aggarwal <amitcs06 gmail com>
Date:   Wed Mar 17 09:17:12 2010 +0000

    Fixes NB#613114, Date string is leaked in MSOffice extractor

 src/tracker-extract/tracker-extract-msoffice.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-msoffice.c b/src/tracker-extract/tracker-extract-msoffice.c
index f4d4cdb..e38262c 100644
--- a/src/tracker-extract/tracker-extract-msoffice.c
+++ b/src/tracker-extract/tracker-extract-msoffice.c
@@ -1703,10 +1703,15 @@ xml_text_handler_document_data (GMarkupParseContext  *context,
 		tracker_sparql_builder_object_unvalidated (info->metadata, text);
 		break;
 
-	case MS_OFFICE_XML_TAG_CREATED:
+	case MS_OFFICE_XML_TAG_CREATED: {
+		gchar *date;
+
+		date = tracker_date_guess (text);
 		tracker_sparql_builder_predicate (info->metadata, "nie:contentCreated");
-		tracker_sparql_builder_object_unvalidated (info->metadata, tracker_date_guess (text));
+		tracker_sparql_builder_object_unvalidated (info->metadata, date);
+		g_free (date);
 		break;
+	}
 
 	case MS_OFFICE_XML_TAG_GENERATOR:
 		if (!added) {
@@ -1723,10 +1728,15 @@ xml_text_handler_document_data (GMarkupParseContext  *context,
 		 */
 		break;
 
-	case MS_OFFICE_XML_TAG_MODIFIED:
+	case MS_OFFICE_XML_TAG_MODIFIED: {
+		gchar *date;
+
+                date = tracker_date_guess (text);
 		tracker_sparql_builder_predicate (info->metadata, "nie:contentLastModified");
-		tracker_sparql_builder_object_unvalidated (info->metadata, tracker_date_guess (text));
+		tracker_sparql_builder_object_unvalidated (info->metadata, date);
+                g_free (date);
 		break;
+	}
 
 	case MS_OFFICE_XML_TAG_NUM_OF_PAGES:
 		tracker_sparql_builder_predicate (info->metadata, "nfo:pageCount");



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