X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fpython%2Frrdtoolmodule.c;fp=bindings%2Fpython%2Frrdtoolmodule.c;h=85f63c7eabb56deb6dbbfda79e5aba72a472b70d;hb=fa908e68adb7ba747ef86c2cc62edc103b07aa2d;hp=6cc22ad632eabaf17dbaad6f8040f3ac3960db3c;hpb=1287bb0b2b8677c7206f3100676372043a54084c;p=rrdtool.git diff --git a/bindings/python/rrdtoolmodule.c b/bindings/python/rrdtoolmodule.c index 6cc22ad..85f63c7 100644 --- a/bindings/python/rrdtoolmodule.c +++ b/bindings/python/rrdtoolmodule.c @@ -466,6 +466,7 @@ static PyObject *PyDict_FromInfo( } if (val) { PyDict_SetItemString(r, data->key, val); + Py_DECREF(val); } data = data->next; } @@ -490,10 +491,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; } @@ -515,10 +519,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; } @@ -540,10 +547,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; }