Skip to content

Commit

Permalink
use PyMem_Calloc() to initialize memory
Browse files Browse the repository at this point in the history
  • Loading branch information
dholth committed Nov 8, 2022
1 parent 6867bdc commit 1593815
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Next:
-----
* Update Python version support
* Use PyMem_Calloc() to initialize memory to 0.

2022-10-24 0.6.4:
-------------------
Expand Down
4 changes: 2 additions & 2 deletions pycosat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
uses an MIT style license.
*/
#define PYCOSAT_URL "https://pypi.python.org/pypi/pycosat"
#define PYCOSAT_VERSION "0.6.4"
#define PYCOSAT_VERSION "0.6.5"

#include <Python.h>

Expand Down Expand Up @@ -271,7 +271,7 @@ static PyObject* itersolve(PyObject *self, PyObject *args, PyObject *kwds)
if (it->picosat == NULL)
return NULL;

it->mem = PyMem_Malloc(picosat_variables(it->picosat) + 1);
it->mem = PyMem_Calloc(picosat_variables(it->picosat) + 1);
if (it->mem == NULL) {
PyErr_NoMemory();
return NULL;
Expand Down

0 comments on commit 1593815

Please sign in to comment.