]> granicus.if.org Git - liblinear/commitdiff
in load_model() of linear.cpp, parameters for training only won't be assigned...
authorChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Sat, 8 Apr 2017 06:47:35 +0000 (14:47 +0800)
committerChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Sat, 8 Apr 2017 06:47:35 +0000 (14:47 +0800)
linear.cpp

index 231b15fae2ec89972b9086c96bcd504f530b6c38..335941a43bf7a2f8a239d8333d7324bb46e313c6 100644 (file)
@@ -2802,6 +2802,11 @@ struct model *load_model(const char *model_file_name)
        double bias;
        model *model_ = Malloc(model,1);
        parameter& param = model_->param;
+       // parameters for training only won't be assigned, but arrays are assigned as NULL for safety
+       param.nr_weight = 0;
+       param.weight_label = NULL;
+       param.weight = NULL;    
+       param.init_sol = NULL;
 
        model_->label = NULL;