chiark / gitweb /
fix #25
authorSteven G. Johnson <stevenj@mit.edu>
Thu, 18 Sep 2014 16:40:13 +0000 (12:40 -0400)
committerSteven G. Johnson <stevenj@mit.edu>
Thu, 18 Sep 2014 16:40:13 +0000 (12:40 -0400)
bobyqa/bobyqa.c

index 8fc454b67442ef885242e8efda5b230f4ab93eb0..9945b607583eb4b7d716636e30957a3f834bf065 100644 (file)
@@ -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; }