[tracker/wip/carlosg/libtracker-miner-cleanups: 35/36] libtracker-miner: Fix possible leak



commit fdd3468b16a60089c3b8d22f606484b9646c2345
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 25 20:10:23 2017 +0200

    libtracker-miner: Fix possible leak
    
    If we hit some early return conditions, the RootData would be
    leaked.

 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 7d38eb3..0c561ee 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 {


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