}
if (val) {
PyDict_SetItemString(r, data->key, val);
+ Py_DECREF(val);
}
data = data->next;
}
if ((data = rrd_info(argc, argv)) == NULL) {
PyErr_SetString(ErrorObject, rrd_get_error());
rrd_clear_error();
- return NULL;
+ r = NULL;
+ } else {
+ r = PyDict_FromInfo(data);
+ rrd_info_free(data);
}
- r = PyDict_FromInfo(data);
- rrd_info_free(data);
+
+ destroy_args(&argv);
return r;
}
if ((data = rrd_graph_v(argc, argv)) == NULL) {
PyErr_SetString(ErrorObject, rrd_get_error());
rrd_clear_error();
- return NULL;
+ r = NULL;
+ } else {
+ r = PyDict_FromInfo(data);
+ rrd_info_free(data);
}
- r = PyDict_FromInfo(data);
- rrd_info_free(data);
+
+ destroy_args(&argv);
return r;
}
if ((data = rrd_update_v(argc, argv)) == NULL) {
PyErr_SetString(ErrorObject, rrd_get_error());
rrd_clear_error();
- return NULL;
+ r = NULL;
+ } else {
+ r = PyDict_FromInfo(data);
+ rrd_info_free(data);
}
- r = PyDict_FromInfo(data);
- rrd_info_free(data);
+
+ destroy_args(&argv);
return r;
}
-static char PyRRD_flush__doc__[] =
+static char PyRRD_flushcached__doc__[] =
"flush(args..): flush RRD files from memory\n"
" flush [--daemon address] file [file ...]";
-static PyObject *PyRRD_flush(
+static PyObject *PyRRD_flushcached(
PyObject UNUSED(*self),
PyObject * args)
{
int argc;
char **argv;
- if (create_args("flush", args, &argc, &argv) < 0)
+ if (create_args("flushcached", args, &argc, &argv) < 0)
return NULL;
if (rrd_cmd_flush(argc, argv) != 0) {
meth("info", PyRRD_info, PyRRD_info__doc__),
meth("graphv", PyRRD_graphv, PyRRD_graphv__doc__),
meth("updatev", PyRRD_updatev, PyRRD_updatev__doc__),
- meth("flush", PyRRD_flush, PyRRD_flush__doc__),
+ meth("flushcached", PyRRD_flushcached, PyRRD_flushcached__doc__),
{NULL, NULL, 0, NULL}
};