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

Fix: Resource leak #551

Closed
Youw opened this issue May 14, 2023 · 0 comments · Fixed by #552
Closed

Fix: Resource leak #551

Youw opened this issue May 14, 2023 · 0 comments · Fixed by #552
Labels
bug Something isn't working

Comments

@Youw
Copy link
Member

Youw commented May 14, 2023

Windows: hidapi_descriptor_reconstruct.c:

CID 1530054 (2): Wrong sizeof argument (SIZEOF_MISMATCH) [[select issue](https://scan5.scan.coverity.com/defectInstanceId=53225971&fileInstanceId=239845965&mergedDefectId=1530054)]
   	278. alloc_fn: Storage is returned from allocation function malloc.
   	279. var_assign: Assigning: main_item_list = storage returned from malloc(8ULL).
381        struct rd_main_item_node *main_item_list = (struct rd_main_item_node*)malloc(sizeof(main_item_list));
   	
CID 1530055 (#1 of 1): Resource leak (RESOURCE_LEAK)
280. overwrite_var: Overwriting main_item_list in main_item_list = NULL leaks the storage that main_item_list points to.
382        main_item_list = NULL; // List root

Very strange that ASAN didn't catch it.
CC: @JoergAtGithub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant