From: Florian Forster Date: Tue, 8 Dec 2015 13:42:07 +0000 (+0100) Subject: Merge branch 'collectd-5.5' X-Git-Tag: collectd-5.6.0~508 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=42a7c90f4478e98dc970927cfda7ec2e1081f364;p=collectd.git Merge branch 'collectd-5.5' --- 42a7c90f4478e98dc970927cfda7ec2e1081f364 diff --cc src/python.c index 210d785c,c7a82c49..1897b6d8 --- a/src/python.c +++ b/src/python.c @@@ -662,11 -702,16 +692,13 @@@ static PyObject *cpy_register_read(PyOb c->callback = callback; c->data = data; c->next = NULL; - user_data = malloc(sizeof(*user_data)); - user_data->free_func = cpy_destroy_user_data; - user_data->data = c; - plugin_register_complex_read(/* group = */ NULL, buf, - cpy_read_callback, DOUBLE_TO_CDTIME_T (interval), user_data); + + memset (&user_data, 0, sizeof (user_data)); + user_data.free_func = cpy_destroy_user_data; + user_data.data = c; + - ts.tv_sec = interval; - ts.tv_nsec = (interval - ts.tv_sec) * 1000000000; + plugin_register_complex_read(/* group = */ "python", buf, - cpy_read_callback, &ts, &user_data); - ++ cpy_read_callback, DOUBLE_TO_CDTIME_T (interval), &user_data); return cpy_string_to_unicode_or_bytes(buf); }