From: Steven G. Johnson Date: Thu, 18 Sep 2014 16:40:13 +0000 (-0400) Subject: fix #25 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ba1d670da918610b7dc709c2ad9c89fd3b095ce9;p=nlopt.git fix #25 --- diff --git a/bobyqa/bobyqa.c b/bobyqa/bobyqa.c index 8fc454b..9945b60 100644 --- a/bobyqa/bobyqa.c +++ b/bobyqa/bobyqa.c @@ -3101,6 +3101,7 @@ nlopt_result bobyqa(int n, int npt, double *x, nlopt_rescale(U(n), s, x, x); --x; xs = (double *) malloc(sizeof(double) * (U(n))); + if (!xs) { ret = NLOPT_OUT_OF_MEMORY; goto done; } sxl = nlopt_new_rescaled(U(n), s, xl); if (!sxl) { ret = NLOPT_OUT_OF_MEMORY; goto done; }