Skip to content

Commit a7a5e89

Browse files
Fixed a bug where osqpData->defines would be freed twice
1 parent fcc4055 commit a7a5e89

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

c_sources/osqp_mex.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
145145
char cmd[CMD_MAX_LEN];
146146

147147
setString(nrhs, prhs, 0, cmd, CMD_MAX_LEN);
148-
148+
149149
/*
150150
* First check to see if a new object was requested
151151
*/
@@ -253,9 +253,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
253253

254254
// delete the object and its data
255255
if (!strcmp("delete", cmd)) {
256-
257256
osqp_cleanup(osqpData->solver);
258-
if (osqpData->defines) c_free(osqpData->defines);
259257
destroyObject<OsqpData>(prhs[1]);
260258
// Warn if other commands were ignored
261259
if (nlhs != 0 || nrhs != 2)

0 commit comments

Comments
 (0)