From a7a5e8904b2b717bbc72cfbf9161912e56e806a0 Mon Sep 17 00:00:00 2001 From: Amit Solomon Date: Tue, 20 Feb 2024 16:37:24 -0500 Subject: [PATCH] Fixed a bug where osqpData->defines would be freed twice --- c_sources/osqp_mex.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/c_sources/osqp_mex.cpp b/c_sources/osqp_mex.cpp index 9b81121..9892a1b 100755 --- a/c_sources/osqp_mex.cpp +++ b/c_sources/osqp_mex.cpp @@ -145,7 +145,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) char cmd[CMD_MAX_LEN]; setString(nrhs, prhs, 0, cmd, CMD_MAX_LEN); - + /* * First check to see if a new object was requested */ @@ -253,9 +253,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) // delete the object and its data if (!strcmp("delete", cmd)) { - osqp_cleanup(osqpData->solver); - if (osqpData->defines) c_free(osqpData->defines); destroyObject(prhs[1]); // Warn if other commands were ignored if (nlhs != 0 || nrhs != 2)