diff --git a/python-xxhash.c b/python-xxhash.c index a3f26f2..f6ba062 100644 --- a/python-xxhash.c +++ b/python-xxhash.c @@ -110,6 +110,10 @@ static int PYXXH32_init(PYXXH32Object *self, PyObject *args, PyObject *kwargs) } self->xxhash_state = XXH32_init(seed); + if (self->xxhash_state == NULL) { + PyErr_NoMemory(); + return -1; + } return 0; } @@ -221,6 +225,10 @@ static int PYXXH64_init(PYXXH64Object *self, PyObject *args, PyObject *kwargs) } self->xxhash_state = XXH64_init(seed); + if (self->xxhash_state == NULL) { + PyErr_NoMemory(); + return -1; + } return 0; } diff --git a/setup.py b/setup.py index 83ecae4..4b0716c 100644 --- a/setup.py +++ b/setup.py @@ -4,8 +4,8 @@ from setuptools import setup, Extension import os -VERSION = "0.1.1" -XXHASH_VERSION = "r35" +VERSION = "0.1.2" +XXHASH_VERSION = "r36" if os.name == 'posix': extra_compile_args = [