[Pkg-libvirt-commits] [libguestfs] 257/384: php: fix memory leak in OStringList optargs
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 16:57:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit 2b06c27fd76eb2d18a3c1287ed5dfaa80aab4816
Author: Pino Toscano <ptoscano at redhat.com>
Date: Tue Feb 10 16:09:57 2015 +0100
php: fix memory leak in OStringList optargs
Make sure to free the char** created to convert the arguments.
---
generator/php.ml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/generator/php.ml b/generator/php.ml
index 28903d0..b49bf60 100644
--- a/generator/php.ml
+++ b/generator/php.ml
@@ -458,6 +458,16 @@ PHP_FUNCTION (guestfs_last_error)
pr "\n"
| Bool _ | Int _ | Int64 _ | Pointer _ -> ()
) args;
+ List.iter (
+ function
+ | OBool n | OInt n | OInt64 n | OString n -> ()
+ | OStringList n ->
+ let uc_n = String.uppercase n in
+ pr " if ((optargs_s.bitmask & %s_%s_BITMASK) != 0)\n"
+ c_optarg_prefix uc_n;
+ pr " guestfs_efree_stringlist ((char **) optargs_s.%s);\n" n;
+ pr "\n"
+ ) optargs;
(* Check for errors. *)
(match errcode_of_ret ret with
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list