[WIP] bugfix: sol, isol: Address two memory leaks (etc) #63
Open
pstrinkle
wants to merge
23
commits into
ipmitool:master
Choose a base branch
from
pstrinkle:checks
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pstrinkle
commented
Nov 26, 2018
lib/ipmi_sol.c
Outdated
/* ERROR */ | ||
perror("select"); | ||
free(buffer); |
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.
I wasn't sure if they needed to explicitly leave raw mode before exiting -- if so, this can be added here, or this can jump to a cleanup label.
pstrinkle
changed the title
bugfix: Address two memory leaks
bugfix: lib/ipmi_isol/ipmi_sol: Address two memory leaks
Nov 27, 2018
pstrinkle
changed the title
bugfix: lib/ipmi_isol/ipmi_sol: Address two memory leaks
bugfix: sol, isol: Address two memory leaks (etc)
Nov 29, 2018
Alexander, fixed the static bit on these two files. Other cleanup while I had it open. |
Cleanup style and whitespace via clang-format-6.0. Signed-off-by: Patrick Venture <venture@google.com>
The buffer is allocated, and used and then not freed. Signed-off-by: Patrick Venture <venture@google.com>
_in_raw_mode in lib/ipmi_isol.c is used as a boolean therefore use a bool type. Signed-off-by: Patrick Venture <venture@google.com>
Use the currently defined ipmi return code macro values. Signed-off-by: Patrick Venture <venture@google.com>
Use boolean types for boolean variables and not ints. Signed-off-by: Patrick Venture <venture@google.com>
Cleanup whitespace and style via clang-format-6.0. Signed-off-by: Patrick Venture <venture@google.com>
The buffer is allocated, and used and then not freed. Signed-off-by: Patrick Venture <venture@google.com>
Convert _use_sol_for_keepalive from int to bool. The int is treated as a bool, therefore make it one. Signed-off-by: Patrick Venture <venture@google.com>
Convert int _in_raw_mode to bool as it is used as one. Signed-off-by: Patrick Venture <venture@google.com>
Convert int _disable_keepalive to bool as it is used as such. Signed-off-by: Patrick Venture <venture@google.com>
Use bool for enable parameter. It is initially set to -1, which is true for boolean checks. Signed-off-by: Patrick Venture <venture@google.com>
Remove extraneous parentheses from negative value return statements. Signed-off-by: Patrick Venture <venture@google.com>
Use IPMI_CC_OK macro for ccode of 0 to avoid magic numbers. Signed-off-by: Patrick Venture <venture@google.com>
Use boolean type for variables that are used as booleans. Signed-off-by: Patrick Venture <venture@google.com>
The static keyword and return value for a method should be on their own lines per the style guide. Signed-off-by: Patrick Venture <venture@google.com>
The static keyword and function return values must be on their own lines per the style guide. Signed-off-by: Patrick Venture <venture@google.com>
Use boolean type variables in processiSolUserInput instead of treating ints as bools. Signed-off-by: Patrick Venture <venture@google.com>
Use a boolean parameter instead of an int for suspendSelf. Signed-off-by: Patrick Venture <venture@google.com>
Use a boolean parameter in suspendSelf instead of int. Signed-off-by: Patrick Venture <venture@google.com>
Use boolean variable types in processSolUserInput instead of treating ints as bools. Signed-off-by: Patrick Venture <venture@google.com>
try is a keyword in c++, and not c, however, it's generally preferred to avoid using keywords for variable names. Therefore, rename the variable try to try_count. Signed-off-by: Patrick Venture <venture@google.com>
Swap calls to free() with calls to free_n() to leverage helper method and handle clearing pointers after freeing in one step. Signed-off-by: Patrick Venture <venture@google.com>
Swap calls to free() with calls to free_n() to leverage helper method and handle clearing pointers after freeing in one step. Signed-off-by: Patrick Venture <venture@google.com>
There are some memory leak bugfixes here, and then some reworked pieces as you desired. However, it does have a lot of the automated whitespace cleanup. I can spend a bit and rebase all the patches and exclude the whitespace fix patches. |
pstrinkle
changed the title
bugfix: sol, isol: Address two memory leaks (etc)
[WIP] bugfix: sol, isol: Address two memory leaks (etc)
Feb 20, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses two memory leaks. Before fixing each leak, I fixed the style within that specific method. If you approve of the style changes in a different PR, I can start applying that more liberally.