projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.4'
[collectd.git]
/
src
/
pyvalues.c
diff --git
a/src/pyvalues.c
b/src/pyvalues.c
index
4a658d0
..
78e6cf9
100644
(file)
--- a/
src/pyvalues.c
+++ b/
src/pyvalues.c
@@
-419,7
+419,7
@@
static meta_data_t *cpy_build_meta(PyObject *meta) {
meta_data_t *m = NULL;
PyObject *l;
meta_data_t *m = NULL;
PyObject *l;
- if (
!meta
)
+ if (
(meta == NULL) || (meta == Py_None)
)
return NULL;
l = PyDict_Items(meta); /* New reference. */
return NULL;
l = PyDict_Items(meta); /* New reference. */
@@
-427,8
+427,13
@@
static meta_data_t *cpy_build_meta(PyObject *meta) {
cpy_log_exception("building meta data");
return NULL;
}
cpy_log_exception("building meta data");
return NULL;
}
- m = meta_data_create();
s = PyList_Size(l);
s = PyList_Size(l);
+ if (s <= 0) {
+ Py_XDECREF(l);
+ return NULL;
+ }
+
+ m = meta_data_create();
for (i = 0; i < s; ++i) {
const char *string, *keystring;
PyObject *key, *value, *item, *tmp;
for (i = 0; i < s; ++i) {
const char *string, *keystring;
PyObject *key, *value, *item, *tmp;