Commit 719b4933 authored by David Crawshaw's avatar David Crawshaw

plugin: do not leak cRelName on error path

Fixes #17683

Change-Id: I46f45c63796b58e8a8f14e37592231cbe7cd6934
Reviewed-on: https://go-review.googlesource.com/32438Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 54ec7b07
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment