summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c4c70a)
raw | patch | inline | side by side (parent: 1c4c70a)
author | Florian Forster <octo@collectd.org> | |
Tue, 2 Sep 2014 17:48:10 +0000 (19:48 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 2 Sep 2014 17:48:10 +0000 (19:48 +0200) |
Fixes: #716
src/pyvalues.c | patch | blob | history |
diff --git a/src/pyvalues.c b/src/pyvalues.c
index 4a658d060219bdf17b083c6b00de92eab95e88fd..4f5c4ce3ac41eb46f3172e5d8b0cee89a5d50b37 100644 (file)
--- a/src/pyvalues.c
+++ b/src/pyvalues.c
meta_data_t *m = NULL;
PyObject *l;
- if (!meta)
+ if ((meta == NULL) || (meta == Py_None))
return NULL;
l = PyDict_Items(meta); /* New reference. */
cpy_log_exception("building meta data");
return NULL;
}
- m = meta_data_create();
+
s = PyList_Size(l);
+ if (s < 0)
+ return NULL;
+
+ m = meta_data_create();
for (i = 0; i < s; ++i) {
const char *string, *keystring;
PyObject *key, *value, *item, *tmp;