Skip to content

Commit

Permalink
Remove a leak when quit() is used in interactive mode, the buffer hol…
Browse files Browse the repository at this point in the history
…ding the command not beeing freed
  • Loading branch information
vivien-apple committed Sep 2, 2022
1 parent 3522317 commit f274e5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ CHIP_ERROR InteractiveStartCommand::RunCommand()
}
}

if (command != nullptr)
{
free(command);
}

SetCommandExitStatus(CHIP_NO_ERROR);
return CHIP_NO_ERROR;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ el_status_t StopFunction()
}
}

if (command != nullptr) {
free(command);
}

SetCommandExitStatus(CHIP_NO_ERROR);
return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit f274e5d

Please sign in to comment.