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

Possible memory leak on libusb_open errors #570

Closed
thebaron06 opened this issue Mar 15, 2017 · 0 comments · Fixed by #571
Closed

Possible memory leak on libusb_open errors #570

thebaron06 opened this issue Mar 15, 2017 · 0 comments · Fixed by #571

Comments

@thebaron06
Copy link
Contributor

In function stlink_open_usb there is a possible memory leak when the call to libusb_open in line 854 fails. If ret is not zero, the code jumps to the on_error label and list is never freed.

A possible fix would be to free list in case of an error, or to check if list in the code that is exceuted when jumping to the on_error label.

thebaron06 added a commit to thebaron06/stlink that referenced this issue Mar 15, 2017
xor-gate pushed a commit that referenced this issue Mar 15, 2017
@xor-gate xor-gate added this to the v1.3.2 milestone Mar 15, 2017
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants