Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@hunch.net>2013-12-31 03:40:55 +0400
committerJohn Langford <jl@hunch.net>2013-12-31 03:40:55 +0400
commitd2b9b8eab0995b7a643ac7125fe7839939177184 (patch)
tree985771900a27972220937264293390f6b09ea5d0 /vowpalwabbit/parse_args.cc
parente1ae678bdfa35b96bc3f474af6cc36f5e5cddd44 (diff)
fix valgrind sourced bugs
Diffstat (limited to 'vowpalwabbit/parse_args.cc')
-rw-r--r--vowpalwabbit/parse_args.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/vowpalwabbit/parse_args.cc b/vowpalwabbit/parse_args.cc
index a81bebc2..2aff6f56 100644
--- a/vowpalwabbit/parse_args.cc
+++ b/vowpalwabbit/parse_args.cc
@@ -58,7 +58,7 @@ bool valid_ns(char c)
void parse_affix_argument(vw&all, string str) {
if (str.length() == 0) return;
- char*cstr = new char[str.length()+1];
+ char* cstr = (char*)calloc(str.length()+1, sizeof(char));
strcpy(cstr, str.c_str());
char*p = strtok(cstr, ",");
@@ -93,7 +93,7 @@ void parse_affix_argument(vw&all, string str) {
p = strtok(NULL, ",");
}
- delete cstr;
+ free(cstr);
}
vw* parse_args(int argc, char *argv[])
@@ -1030,6 +1030,7 @@ namespace VW {
{
finalize_regressor(all, all.final_regressor_name);
all.l->finish();
+ delete all.l;
if (all.reg.weight_vector != NULL)
free(all.reg.weight_vector);
free_parser(all);