[tracker] libtracker-extract: Fix possible XMP extractor leak
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-extract: Fix possible XMP extractor leak
- Date: Sun, 17 Jan 2016 19:19:32 +0000 (UTC)
commit fa4f72862e616a934ad490c2c4367ca334cbb811
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jan 17 18:58:26 2016 +0100
libtracker-extract: Fix possible XMP extractor leak
We may end up overwriting the TrackerXmpRegion fields here, and
forgetting about the previous memory. Just stick to the first
values if we iterate multiple times here.
src/libtracker-extract/tracker-xmp.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index 42ade15..dda8368 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -573,7 +573,8 @@ iterate_simple (const gchar *uri,
*/
} else if (!current_region->type && g_ascii_strcasecmp (propname, "mwg-rs:Type") ==
0) {
current_region->type = g_strdup (value);
- } else if (g_str_has_prefix (strrchr (path, ']') + 2, "mwg-rs:Extensions")) {
+ } else if (!current_region->link_class && !current_region->link_uri &&
+ g_str_has_prefix (strrchr (path, ']') + 2, "mwg-rs:Extensions")) {
current_region->link_class = g_strdup (propname);
current_region->link_uri = g_strdup (value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]