summaryrefslogtreecommitdiff
path: root/remote.go
diff options
context:
space:
mode:
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/remote.go b/remote.go
index c966aab..9d65d10 100644
--- a/remote.go
+++ b/remote.go
@@ -255,6 +255,10 @@ func credentialsCallback(_cred **C.git_cred, _url *C.char, _username_from_url *C
}
if cred != nil {
*_cred = cred.ptr
+
+ // have transferred ownership to libgit, 'forget' the native pointer
+ cred.ptr = nil
+ runtime.SetFinalizer(cred, nil)
}
return 0
}