X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpyvalues.c;h=78e6cf9d450413ed242fb73e6126a09f4dd86057;hb=b5230d45188e81ae58c889fa69e7e87b79359482;hp=4f5c4ce3ac41eb46f3172e5d8b0cee89a5d50b37;hpb=0f4dc42a2a786763134d9661273608cfb2f52821;p=collectd.git diff --git a/src/pyvalues.c b/src/pyvalues.c index 4f5c4ce3..78e6cf9d 100644 --- a/src/pyvalues.c +++ b/src/pyvalues.c @@ -427,10 +427,11 @@ static meta_data_t *cpy_build_meta(PyObject *meta) { cpy_log_exception("building meta data"); return NULL; } - s = PyList_Size(l); - if (s < 0) + if (s <= 0) { + Py_XDECREF(l); return NULL; + } m = meta_data_create(); for (i = 0; i < s; ++i) {