From: oetiker Date: Mon, 18 May 2009 14:23:23 +0000 (+0000) Subject: integrated fix for debian bug #529291 as supplied by Anders Hammarquist X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=434331266806d7aaed4b63b81cc47b835fdef5bf;p=rrdtool-all.git integrated fix for debian bug #529291 as supplied by Anders Hammarquist git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3@1800 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/bindings/python/rrdtoolmodule.c b/program/bindings/python/rrdtoolmodule.c index 27717207..2df98066 100644 --- a/program/bindings/python/rrdtoolmodule.c +++ b/program/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; }