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

[Coverity CID :208913] Resource leak in tests/net/socket/af_packet/src/main.c #23587

Closed
zephyrbot opened this issue Mar 18, 2020 · 1 comment
Closed
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/master/tests/net/socket/af_packet/src/main.c#L142

Category: Resource leaks
Function: test_packet_sockets
Component: Tests
CID: 208913

Details:

136    
137         ret = bind_socket(sock1, ud.first);
138         zassert_equal(ret, 0, "Cannot bind 1st socket (%d)", -errno);
139    
140         ret = bind_socket(sock2, ud.second);
141         zassert_equal(ret, 0, "Cannot bind 2nd socket (%d)", -errno);
>>>     CID 208913:  Resource leaks  (RESOURCE_LEAK)
>>>     Handle variable "sock1" going out of scope leaks the handle.
142     }
143    
144     void test_main(void)
145     {
146         ztest_test_suite(socket_packet,
147                  ztest_unit_test(test_packet_sockets));
148         ztest_run_test_suite(socket_packet);

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Mar 18, 2020
@jukkar
Copy link
Member

jukkar commented Mar 18, 2020

False positive

@jukkar jukkar closed this as completed Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants