]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
freemem only for valid status
authorChristian Kröger <commx@commx.ws>
Thu, 6 Feb 2020 23:43:18 +0000 (00:43 +0100)
committerChristian Kröger <commx@commx.ws>
Thu, 6 Feb 2020 23:43:18 +0000 (00:43 +0100)
bindings/python/rrdtoolmodule.c

index 9344c862b34f1a74695055c0eddca9ce6db90db3..f02058204e3919c9ecd13f0da371662bb5757d29 100644 (file)
@@ -476,10 +476,11 @@ _rrdtool_fetch(PyObject *Py_UNUSED(self), PyObject *args)
 
         for (i = 0; i < ds_cnt; i++)
             rrd_freemem(ds_namv[i]);
+
+        rrd_freemem(ds_namv);
+        rrd_freemem(data);
     }
 
-    rrd_freemem(ds_namv);
-    rrd_freemem(data);
     destroy_args(&rrdtool_argv);
     return ret;
 }