fix SIGSERV on double free for Cred object

This commit is contained in:
Vladimir Buzuev 2020-03-26 14:43:43 -07:00
parent 3a2102638d
commit 033ad6e5ef
1 changed files with 2 additions and 0 deletions

View File

@ -254,6 +254,8 @@ func credentialsCallback(_cred **C.git_cred, _url *C.char, _username_from_url *C
return C.GIT_EUSER
}
if cred != nil {
// we are transferring ownership to libgit, have to disable
runtime.SetFinalizer(cred, nil)
*_cred = cred.ptr
}
return 0