[libgit2-glib/wip/development] Fix walk_callback_wrapper



commit f1ad8a31a6e60217c455771396b9693a742256ce
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Apr 26 21:45:20 2014 +0200

    Fix walk_callback_wrapper

 libgit2-glib/ggit-tree.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libgit2-glib/ggit-tree.c b/libgit2-glib/ggit-tree.c
index 7b6250e..cfeb66e 100644
--- a/libgit2-glib/ggit-tree.c
+++ b/libgit2-glib/ggit-tree.c
@@ -214,12 +214,17 @@ walk_callback_wrapper (const char           *root,
        gint ret;
        GgitTreeEntry *wentry;
        WalkInfo *info = (WalkInfo *)payload;
+       git_tree_entry *dest;
 
-       wentry = _ggit_tree_entry_wrap (git_tree_entry_dup(entry), TRUE);
+       ret = git_tree_entry_dup (&dest, entry);
+       if (ret == GIT_OK)
+       {
+               wentry = _ggit_tree_entry_wrap (dest, TRUE);
 
-       ret = info->callback(root, wentry, info->user_data);
+               ret = info->callback(root, wentry, info->user_data);
 
-       ggit_tree_entry_unref (wentry);
+               ggit_tree_entry_unref (wentry);
+       }
 
        return ret;
 }


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