Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Correct memory allocation in getConsVars
  • Loading branch information
Joao-Dionisio committed Jul 24, 2025
commit 4b2e48a8c80efa5071e539d524a84a6a17d4ebb3
2 changes: 1 addition & 1 deletion src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
if rc == SCIP_OKAY:
pass
elif rc == SCIP_ERROR:
raise Exception('SCIP: unspecified error!')

Check failure on line 304 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / test-coverage (3.11)

SCIP: unspecified error!
elif rc == SCIP_NOMEMORY:
raise MemoryError('SCIP: insufficient memory error!')
elif rc == SCIP_READERROR:
Expand Down Expand Up @@ -6031,7 +6031,7 @@

SCIPgetConsNVars(self._scip, constraint.scip_cons, &nvars, &success)
_vars = <SCIP_VAR**> malloc(nvars * sizeof(SCIP_VAR*))
SCIPgetConsVars(self._scip, constraint.scip_cons, _vars, nvars*sizeof(SCIP_VAR*), &success)
SCIPgetConsVars(self._scip, constraint.scip_cons, _vars, nvars, &success)

vars = []
for i in range(nvars):
Expand Down