X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=bindings%2Fpython%2Frrdtoolmodule.c;h=2df98066f140af33fe63798cd4dea54019ebee0b;hb=51c3d3fb997c22e1ee828470413f1e84989e1f6c;hp=2771720711310ab670cfc1e0ac2589122cae0c2d;hpb=1559397b94b4af3de73cfa23c04be31d8bee53e7;p=pkg-rrdtool.git diff --git a/bindings/python/rrdtoolmodule.c b/bindings/python/rrdtoolmodule.c index 2771720..2df9806 100644 --- a/bindings/python/rrdtoolmodule.c +++ b/bindings/python/rrdtoolmodule.c @@ -435,6 +435,7 @@ static PyObject *PyDict_FromInfo( } if (val) { PyDict_SetItemString(r, data->key, val); + Py_DECREF(val); } data = data->next; } @@ -459,10 +460,13 @@ static PyObject *PyRRD_info( 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; } @@ -484,10 +488,13 @@ static PyObject *PyRRD_graphv( 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; } @@ -509,10 +516,13 @@ static PyObject *PyRRD_updatev( 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; }