Fixes and clearing memory
This commit is contained in:
parent
e798e30cf2
commit
6f3fb01ffb
1 changed files with 5 additions and 1 deletions
|
@ -146,9 +146,9 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
|
|||
char* key = new char[p.key().length() + 1];
|
||||
strcpy(key, p.key().c_str());
|
||||
arguments_w_json.push_back(key);
|
||||
std::string param_value;
|
||||
|
||||
if (!p.value().is_boolean()) {
|
||||
std::string param_value;
|
||||
if (p.value().is_string()) {
|
||||
param_value = p.value().get<std::string>();
|
||||
} else if (p.value().is_number()) {
|
||||
|
@ -182,6 +182,10 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
|
|||
gpt_print_usage(argc_json, argv_json, gpt_params());
|
||||
exit(1);
|
||||
}
|
||||
// clearing pointers
|
||||
for (auto c : arguments_w_json) {
|
||||
delete [] c;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue