[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 41/116] libtracker-miner: Fix possible leak



commit 3e111e46b928bbe9f0d82094877f38761722dd8c
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 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 8555f8af5..e88117a79 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]