use the standart info free function
[rrdtool.git] / bindings / perl-shared / RRDs.xs
index bf9a612..25d44a5 100644 (file)
@@ -78,8 +78,8 @@ extern "C" {
                free(argv); \
                 if (rrd_test_error()) XSRETURN_UNDEF; \
                 hash = newHV(); \
+               save=data; \
                 while (data) { \
-                   save=data; \
                /* the newSV will get copied by hv so we create it as a mortal \
            to make sure it does not keep hanging round after the fact */ \
                    switch (data->type) { \
@@ -97,18 +97,14 @@ extern "C" {
                        break; \
                    case RD_I_STR: \
                        hvs(newSVpv(data->value.u_str,0)); \
-                       rrd_freemem(data->value.u_str); \
                        break; \
                    case RD_I_BLO: \
                        hvs(newSVpv(data->value.u_blo.ptr,data->value.u_blo.size)); \
-                       rrd_freemem(data->value.u_blo.ptr); \
                        break; \
                    } \
-                   rrd_freemem(data->key); \
                    data = data->next; \
-                   rrd_freemem(save); \
-                   } \
-            rrd_freemem(data); \
+               } \
+            rrd_info_free(save); \
             RETVAL = newRV_noinc((SV*)hash);
 
 /*