From c243218b120fb9b6ac5444ba4bc26b14c7280eee Mon Sep 17 00:00:00 2001 From: Joao-Dionisio Date: Tue, 21 Nov 2023 14:16:56 +0000 Subject: [PATCH] Fix pointer --- src/pyscipopt/scip.pxi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/scip.pxi b/src/pyscipopt/scip.pxi index 302bc7261..c2fde60b0 100644 --- a/src/pyscipopt/scip.pxi +++ b/src/pyscipopt/scip.pxi @@ -2169,7 +2169,7 @@ cdef class Model: SCIPgetConsNVars(self._scip, constraint.scip_cons, &_nvars, &success) cdef SCIP_VAR** _vars = 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*sizeof(SCIP_VAR*), &success) vars = [] for i in range(_nvars): @@ -4459,6 +4459,8 @@ cdef class Model: """ cdef SCIP_SOL* _sol _sol = solution.sol + + assert _sol != NULL, "Cannot set value to a freed solution." PY_SCIP_CALL(SCIPsetSolVal(self._scip, _sol, var.scip_var, val)) def trySol(self, Solution solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, free=True):