mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
@@ -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 () =
|
||||
|
||||
Reference in New Issue
Block a user