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

Cannot free struct returned by uio_find_by_uio_num() #13

Open
bear101 opened this issue Jul 25, 2018 · 3 comments
Open

Cannot free struct returned by uio_find_by_uio_num() #13

bear101 opened this issue Jul 25, 2018 · 3 comments

Comments

@bear101
Copy link

bear101 commented Jul 25, 2018

https://github.com/Linutronix/libuio/blob/ca28ff0f69d89a789a47552c72db5a43d280710b/base.c#L278

uio_find_by_uio_num() creates a uio_info-struct but how does the user free this element? uio_free_info() doesn't exist in any header file.

@bear101
Copy link
Author

bear101 commented Jul 25, 2018

Hm, same issue for uio_find_devices().

free() only clears the struct but not it's members:
https://github.com/Linutronix/libuio/blob/master/helper.c#L264

So a user of libuio cannot avoid leaking memory if they use uio_find_devices() or uio_find_by_uio_num().

@modbw
Copy link
Contributor

modbw commented Sep 2, 2021

This should be fixed by #20

@Baruch-Fridman
Copy link

This should be fixed by #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants