diff options
author | John Langford <jl@nyclamp.(none)> | 2014-03-31 19:51:01 +0400 |
---|---|---|
committer | John Langford <jl@nyclamp.(none)> | 2014-03-31 19:51:01 +0400 |
commit | ce8ffc8ff5821cc45f28739bc0889dc697dc8f98 (patch) | |
tree | fb0ef43ec0e37097dd156ae9b24d5295bb97b438 /vowpalwabbit/gd_mf.cc | |
parent | 5023ab65297cc03427afc8ca3d2c7730383b633f (diff) |
error check all calls to calloc
Diffstat (limited to 'vowpalwabbit/gd_mf.cc')
-rw-r--r-- | vowpalwabbit/gd_mf.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/vowpalwabbit/gd_mf.cc b/vowpalwabbit/gd_mf.cc index 00699f34..281fed98 100644 --- a/vowpalwabbit/gd_mf.cc +++ b/vowpalwabbit/gd_mf.cc @@ -5,21 +5,20 @@ license as described in the file LICENSE. */ #include <fstream> #include <float.h> +#include <string.h> +#include <stdio.h> #ifdef _WIN32 #include <winsock2.h> #else #include <netdb.h> #endif -#include <string.h> -#include <stdio.h> -#include "parse_example.h" + #include "constant.h" #include "sparse_dense.h" #include "gd.h" -#include "cache.h" #include "simple_label.h" #include "rand48.h" -#include "vw.h" +#include "reductions.h" using namespace std; @@ -289,7 +288,7 @@ void end_pass(gdmf& d) learner* setup(vw& all) { - gdmf* data = (gdmf*)calloc(1,sizeof(gdmf)); + gdmf* data = (gdmf*)calloc_or_die(1,sizeof(gdmf)); data->all = &all; learner* l = new learner(data, all.reg.stride); l->set_learn<gdmf, learn>(); |