mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
plugin: do not leak cRelName on error path
Fixes #17683 Change-Id: I46f45c63796b58e8a8f14e37592231cbe7cd6934 Reviewed-on: https://go-review.googlesource.com/32438 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
54ec7b072e
commit
719b493312
1 changed files with 1 additions and 1 deletions
|
|
@ -44,10 +44,10 @@ func open(name string) (*Plugin, error) {
|
|||
defer C.free(unsafe.Pointer(cPath))
|
||||
|
||||
cRelName := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(cRelName))
|
||||
if C.realpath(cRelName, cPath) == nil {
|
||||
return nil, errors.New("plugin.Open(" + name + "): realpath failed")
|
||||
}
|
||||
C.free(unsafe.Pointer(cRelName))
|
||||
|
||||
filepath := C.GoString(cPath)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue