From cb557711a430ce938ea06aec4a9966d9bd93e13c Mon Sep 17 00:00:00 2001 From: Chih-Jen Lin Date: Sat, 8 Apr 2017 14:47:35 +0800 Subject: [PATCH] in load_model() of linear.cpp, parameters for training only won't be assigned after reading the model. However, we initialize arrays as NULL for safety. This follows the earlier change in libsvm --- linear.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linear.cpp b/linear.cpp index 231b15f..335941a 100644 --- a/linear.cpp +++ b/linear.cpp @@ -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; -- 2.50.1