Skip to content

Commit

Permalink
sol: swap free() calls for free_n()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pstrinkle committed Dec 25, 2018
1 parent d48e99f commit 90ed0ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ipmi_sol.c
Expand Up @@ -1571,7 +1571,7 @@ ipmi_sol_red_pill(struct ipmi_intf *intf, int instance)
if (retval == -1) {
/* ERROR */
perror("select");
free(buffer);
free_n(&buffer);
return -1;
}

Expand Down Expand Up @@ -1623,7 +1623,7 @@ ipmi_sol_red_pill(struct ipmi_intf *intf, int instance)
}

leave_raw_mode();
free(buffer);
free_n(&buffer);

if (keepAliveRet != 0) {
lprintf(LOG_ERR,
Expand Down

0 comments on commit 90ed0ef

Please sign in to comment.