summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8e7d332)
raw | patch | inline | side by side (parent: 8e7d332)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:12:46 +0000 (18:12 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 16:12:46 +0000 (18:12 +0200) |
src/python.c | patch | blob | history |
diff --git a/src/python.c b/src/python.c
index b90902498d69fdb1b48e3048ac6515dda3200399..1f808496b6eaa71621ec7076a8ae933388eaeb39 100644 (file)
--- a/src/python.c
+++ b/src/python.c
@@ -552,10 +552,9 @@ static PyObject *cpy_register_generic(cpy_callback_t **list_head, PyObject *args
Py_INCREF(callback);
Py_XINCREF(data);
- c = malloc(sizeof(*c));
+ c = calloc(1, sizeof(*c));
if (c == NULL)
return NULL;
- memset (c, 0, sizeof (*c));
c->name = strdup(buf);
c->callback = callback;
@@ -644,10 +643,9 @@ static PyObject *cpy_register_generic_userdata(void *reg, void *handler, PyObjec
Py_INCREF(callback);
Py_XINCREF(data);
- c = malloc(sizeof(*c));
+ c = calloc(1, sizeof(*c));
if (c == NULL)
return NULL;
- memset (c, 0, sizeof (*c));
c->name = strdup(buf);
c->callback = callback;
@@ -683,10 +681,9 @@ static PyObject *cpy_register_read(PyObject *self, PyObject *args, PyObject *kwd
Py_INCREF(callback);
Py_XINCREF(data);
- c = malloc(sizeof(*c));
+ c = calloc(1, sizeof(*c));
if (c == NULL)
return NULL;
- memset (c, 0, sizeof (*c));
c->name = strdup(buf);
c->callback = callback;