diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-10-25 20:10:23 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-11-14 22:45:27 +0100 |
commit | 376fda8adced2f982b85b95a062439bfcf8ae17f (patch) | |
tree | 02c366e754826238790305f01665704ae84414b6 | |
parent | 38d296733e5edc0cd1ac5c5dd9b1e03cc74cf662 (diff) | |
download | tracker-376fda8adced2f982b85b95a062439bfcf8ae17f.tar.gz |
libtracker-miner: Fix possible leak
If we hit some early return conditions, the RootData would be
leaked.
-rw-r--r-- | src/libtracker-miner/tracker-file-notifier.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c index 7d38eb33f..0c561ee8e 100644 --- a/src/libtracker-miner/tracker-file-notifier.c +++ b/src/libtracker-miner/tracker-file-notifier.c @@ -1019,7 +1019,7 @@ notifier_queue_file (TrackerFileNotifier *notifier, TrackerDirectoryFlags flags) { TrackerFileNotifierPrivate *priv = notifier->priv; - RootData *data = root_data_new (notifier, file, flags); + RootData *data; if (priv->current_index_root && priv->current_index_root->root == file) @@ -1029,6 +1029,8 @@ notifier_queue_file (TrackerFileNotifier *notifier, (GCompareFunc) find_directory_root)) return; + data = root_data_new (notifier, file, flags); + if (flags & TRACKER_DIRECTORY_FLAG_PRIORITY) { priv->pending_index_roots = g_list_prepend (priv->pending_index_roots, data); } else { |