Skip to content

Commit e9a242e

Browse files
authored
Merge pull request #754 from scipopt/issue-753
Fix pointer
2 parents 4633ad8 + e9f8623 commit e9a242e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pyscipopt/scip.pxi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ cdef class Model:
21692169
SCIPgetConsNVars(self._scip, constraint.scip_cons, &_nvars, &success)
21702170

21712171
cdef SCIP_VAR** _vars = <SCIP_VAR**> malloc(_nvars * sizeof(SCIP_VAR*))
2172-
SCIPgetConsVars(self._scip, constraint.scip_cons, _vars, _nvars*sizeof(SCIP_VAR), &success)
2172+
SCIPgetConsVars(self._scip, constraint.scip_cons, _vars, _nvars*sizeof(SCIP_VAR*), &success)
21732173

21742174
vars = []
21752175
for i in range(_nvars):
@@ -4457,6 +4457,8 @@ cdef class Model:
44574457
"""
44584458
cdef SCIP_SOL* _sol
44594459
_sol = <SCIP_SOL*>solution.sol
4460+
4461+
assert _sol != NULL, "Cannot set value to a freed solution."
44604462
PY_SCIP_CALL(SCIPsetSolVal(self._scip, _sol, var.scip_var, val))
44614463

44624464
def trySol(self, Solution solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, free=True):

0 commit comments

Comments
 (0)