From a398947aa3734738a27fc7b2811ef72fbcbfcd90 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 7 Dec 2017 12:03:09 +0000 Subject: Travis: fixes --- src/mathfunc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mathfunc.cpp') diff --git a/src/mathfunc.cpp b/src/mathfunc.cpp index 644b3e8..2cce43f 100644 --- a/src/mathfunc.cpp +++ b/src/mathfunc.cpp @@ -264,8 +264,12 @@ bool isMatrixPositiveDefinite(const gsl_matrix *G) { auto s = gsl_linalg_cholesky_decomp(G2); #endif gsl_set_error_handler(handler); - gsl_matrix_safe_free(G2); - return (s == GSL_SUCCESS); + if (s == GSL_SUCCESS) { + gsl_matrix_safe_free(G2); + return true; + } + gsl_matrix_free(G2); + return (false); } gsl_vector *getEigenValues(const gsl_matrix *G) { -- cgit v1.2.3