Fix memory leak in rebase

This commit is contained in:
Michael Boulton 2020-08-14 15:53:10 +01:00
parent 23fcabf687
commit 0c942dbd89
No known key found for this signature in database
GPG Key ID: 8A62CA0BE2E0197E
1 changed files with 1 additions and 0 deletions

View File

@ -95,6 +95,7 @@ func commitSignCallback(_signature *C.git_buf, _signature_field *C.git_buf, _com
fillBuf := func(bufData string, buf *C.git_buf) error {
clen := C.size_t(len(bufData))
cstr := unsafe.Pointer(C.CString(bufData))
defer C.free(cstr)
// over-assign by a byte (see below)
if int(C.git_buf_grow(buf, clen+1)) != 0 {