-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
libnvmf: avoid resource leak #1239
Conversation
Cc @bsdjhb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.. borderline worth it because this usually is adjacent to an exitvpath, but it is in a library.
Tagged with 'ready' but I'll give it until tomorrow for @bsdjhb to take. peek |
The other error cases in the loop after the realloc all call free, so this is more consistent. |
Would maybe s/first loop cycle/previous loop iteration/ in the log message. "again" might also be confusing as you aren't calling free multiple times, so I would perhaps omit it from the log message. |
a009674
to
fe3edfa
Compare
The |
In nvmf_host_fetch_discovery_log_page(), the log variable may have been allocated on the heap during the first loop cycle, and should be free()'d before exiting upon errors. Reported by: Coverity CID: 1545034 Sponsored by: The FreeBSD Foundation Reviewed by: imp,jhb Pull Request: freebsd#1239
fe3edfa
to
1ea2f56
Compare
MFC after: 3 days Fixes: 286c490 (add -noauto), 3914ddf (import autofs) Pull Request: freebsd#1243 Reviewed by: imp Pull Request: freebsd#1243
Reviewed by: imp,jhb Pull Request: freebsd#1242
Reviewed by: imp,jhb Pull Request: freebsd#1241
In nvmf_host_fetch_discovery_log_page(), the log variable may have been allocated on the heap during the first loop cycle, and should be free()'d before exiting upon errors. Reported by: Coverity CID: 1545034 Sponsored by: The FreeBSD Foundation Reviewed by: imp,jhb Pull Request: freebsd#1239
1ea2f56
to
408572a
Compare
In nvmf_host_fetch_discovery_log_page(), the log variable may have been allocated on the heap during a first loop cycle, and should be free()'d again before exiting upon errors.
Reported by: Coverity
CID: 1545034
Sponsored by: The FreeBSD Foundation