]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
bindings/rrdtoolmodule.c: fix Coverity CIDs #32891, #32892 Resource leak
authorMarek Schimara <Marek.Schimara@bull.net>
Thu, 4 May 2017 08:55:04 +0000 (10:55 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 4 May 2017 09:56:42 +0000 (11:56 +0200)
bindings/python/rrdtoolmodule.c

index 6fe62e6d01dd237f997831e3b6de965be7b298f7..95a1db33d0838150a61ed040109d60040cc73154 100644 (file)
@@ -1056,8 +1056,12 @@ _rrdtool_lastupdate(PyObject *Py_UNUSED(self), PyObject *args)
                 val = PyFloat_FromDouble(num);
             }
 
-            if (!val)
+            if (!val) {
+               free(last_ds[i]);
+               free(last_ds);
+               free(ds_names);
                 return NULL;
+            }
 
             PyDict_SetItemString(ds_dict, ds_names[i], val);
             Py_DECREF(val);