Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: leaked C.CString in plugin_dlopen.go #17683

Closed
gonzalop opened this issue Oct 31, 2016 · 1 comment
Closed

plugin: leaked C.CString in plugin_dlopen.go #17683

gonzalop opened this issue Oct 31, 2016 · 1 comment
Milestone

Comments

@gonzalop
Copy link

gonzalop commented Oct 31, 2016

cRelName in https://github.com/golang/go/blob/master/src/plugin/plugin_dlopen.go#L46 is not freed if realpath fails:

cRelName := C.CString(name)
if C.realpath(cRelName, cPath) == nil {
    C.free(unsafe.Pointer(cRelName)) // <=== This line should be added to the code.
    return nil, errors.New("plugin.Open(" + name + "): realpath failed")
}
C.free(unsafe.Pointer(cRelName))
@gopherbot
Copy link

CL https://golang.org/cl/32438 mentions this issue.

@rakyll rakyll changed the title Leaked C.CString in plugin_dlopen.go plugin: leaked C.CString in plugin_dlopen.go Oct 31, 2016
@rakyll rakyll added this to the Go1.8 milestone Oct 31, 2016
@golang golang locked and limited conversation to collaborators Nov 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants