summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e413a7)
raw | patch | inline | side by side (parent: 3e413a7)
author | Florian Forster <octo@collectd.org> | |
Tue, 8 Dec 2015 12:44:28 +0000 (13:44 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 8 Dec 2015 12:44:28 +0000 (13:44 +0100) |
CID: 37981, 37982, 37983
src/python.c | patch | blob | history |
diff --git a/src/python.c b/src/python.c
index 6a65ff25c5de4dff9d17de281c3abbd269f33981..10d283d95b1c7a6ee1938a1cc40fdcbcc70fa60b 100644 (file)
--- a/src/python.c
+++ b/src/python.c
@@ -534,7 +534,12 @@ static PyObject *cpy_register_generic(cpy_callback_t **list_head, PyObject *args
Py_INCREF(callback);
Py_XINCREF(data);
+
c = malloc(sizeof(*c));
+ if (c == NULL)
+ return NULL;
+ memset (c, 0, sizeof (*c));
+
c->name = strdup(buf);
c->callback = callback;
c->data = data;
@@ -589,7 +594,12 @@ static PyObject *cpy_register_generic_userdata(void *reg, void *handler, PyObjec
Py_INCREF(callback);
Py_XINCREF(data);
+
c = malloc(sizeof(*c));
+ if (c == NULL)
+ return NULL;
+ memset (c, 0, sizeof (*c));
+
c->name = strdup(buf);
c->callback = callback;
c->data = data;
@@ -624,7 +634,12 @@ static PyObject *cpy_register_read(PyObject *self, PyObject *args, PyObject *kwd
Py_INCREF(callback);
Py_XINCREF(data);
+
c = malloc(sizeof(*c));
+ if (c == NULL)
+ return NULL;
+ memset (c, 0, sizeof (*c));
+
c->name = strdup(buf);
c->callback = callback;
c->data = data;