[libgit2-glib] Use correct free functions



commit 0c28c3af2c83e84a0a368ea9ff12502ee3cbbbde
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date:   Wed Feb 26 10:12:52 2020 +0100

    Use correct free functions

 libgit2-glib/ggit-cred-plaintext.c          | 6 +++++-
 libgit2-glib/ggit-cred-ssh-interactive.c    | 6 +++++-
 libgit2-glib/ggit-cred-ssh-key-from-agent.c | 6 +++++-
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/libgit2-glib/ggit-cred-plaintext.c b/libgit2-glib/ggit-cred-plaintext.c
index 6ae3218..1f2390f 100644
--- a/libgit2-glib/ggit-cred-plaintext.c
+++ b/libgit2-glib/ggit-cred-plaintext.c
@@ -179,7 +179,11 @@ ggit_cred_plaintext_initable_init (GInitable    *initable,
 
        _ggit_native_set (initable,
                          cred,
-                         (GDestroyNotify)cred->free);
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 99)
+                         (GDestroyNotify)git_credential_free (cred));
+#else
+                         (GDestroyNotify)git_cred_free (cred));
+#endif
 
        return TRUE;
 }
diff --git a/libgit2-glib/ggit-cred-ssh-interactive.c b/libgit2-glib/ggit-cred-ssh-interactive.c
index 97f51cf..79e5a4e 100644
--- a/libgit2-glib/ggit-cred-ssh-interactive.c
+++ b/libgit2-glib/ggit-cred-ssh-interactive.c
@@ -246,7 +246,11 @@ ggit_cred_ssh_interactive_initable_init (GInitable     *initable,
 
        _ggit_native_set (initable,
                          cred,
-                         (GDestroyNotify)cred->free);
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 99)
+                         (GDestroyNotify)git_credential_free (cred));
+#else
+                         (GDestroyNotify)git_cred_free (cred));
+#endif
 
        return TRUE;
 }
diff --git a/libgit2-glib/ggit-cred-ssh-key-from-agent.c b/libgit2-glib/ggit-cred-ssh-key-from-agent.c
index 2931b43..0de589f 100644
--- a/libgit2-glib/ggit-cred-ssh-key-from-agent.c
+++ b/libgit2-glib/ggit-cred-ssh-key-from-agent.c
@@ -155,7 +155,11 @@ ggit_cred_ssh_key_from_agent_initable_init (GInitable     *initable,
 
        _ggit_native_set (initable,
                          cred,
-                         (GDestroyNotify)cred->free);
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 99)
+                         (GDestroyNotify)git_credential_free (cred));
+#else
+                         (GDestroyNotify)git_cred_free (cred));
+#endif
 
        return TRUE;
 }


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