perl: fix memory leak in RStruct actions

The return value struct was freed using a simple free() instead of the
own cleanup function of each struct: this meant dynamically allocated
values (such as strings) were leaked.

Use the proper cleanup functions instead.
This commit is contained in:
Pino Toscano
2016-12-12 14:02:35 +01:00
parent 9089b9eaa2
commit 99834b85b2

View File

@@ -657,7 +657,7 @@ and generate_perl_struct_code typ cols name style n =
pr " PUSHs (sv_2mortal (newSVnv (r->%s)));\n"
name
) cols;
pr " free (r);\n"
pr " guestfs_free_%s (r);\n" typ
(* Generate Sys/Guestfs.pm. *)
and generate_perl_pm () =