[libgit2-glib] Missing check before freeing clone options



commit 47811ee5ace36f2f8934c7e5d3d51dae6e6243d6
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Mar 21 17:39:27 2013 +0100

    Missing check before freeing clone options

 libgit2-glib/ggit-repository.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 6a9499d..5f6ecf9 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -82,7 +82,11 @@ ggit_repository_finalize (GObject *object)
        g_free (priv->url);
        g_clear_object (&priv->location);
        g_clear_object (&priv->workdir);
-       ggit_clone_options_free (priv->clone_options);
+
+       if (priv->clone_options != NULL)
+       {
+               ggit_clone_options_free (priv->clone_options);
+       }
 
        G_OBJECT_CLASS (ggit_repository_parent_class)->finalize (object);
 }


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