diff options
| author | lhchavez <[email protected]> | 2020-03-26 17:50:12 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-26 17:50:12 -0700 |
| commit | 0843b826d219b16d55d3bb7fffbb5fb3fbbf82f8 (patch) | |
| tree | 9330757c7ce09c8023616a91c8099ddb4c15aebb /remote.go | |
| parent | 3a2102638d64cd76e50f51577e8bb2b8f9c7035f (diff) | |
| parent | 89dc80bbea1a418182d31fcdb34b0c2ebeaf7c16 (diff) | |
Fix SIGSEGV on double free for Cred object
This change removes the Go finalizer when passing ownership to libgit2.
Fixes: #553
Diffstat (limited to 'remote.go')
| -rw-r--r-- | remote.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 } |
