Richard W.M. Jones
2018-Jan-22 17:06 UTC
[Libguestfs] [PATCH] perl: Free array on error path to avoid leak (RHBZ#1536765).
--- generator/perl.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generator/perl.ml b/generator/perl.ml index 240bf3b54..5fa00a92d 100644 --- a/generator/perl.ml +++ b/generator/perl.ml @@ -122,8 +122,10 @@ XS_unpack_charPtrPtr (SV *arg) { for (i = 0; i <= av_len (av); i++) { SV **elem = av_fetch (av, i, 0); - if (!elem || !*elem) + if (!elem || !*elem) { + free (ret); croak (\"missing element in list\"); + } ret[i] = SvPV_nolen (*elem); } -- 2.13.2
Pino Toscano
2018-Jan-22 17:22 UTC
Re: [Libguestfs] [PATCH] perl: Free array on error path to avoid leak (RHBZ#1536765).
On Monday, 22 January 2018 18:06:23 CET Richard W.M. Jones wrote:> --- > generator/perl.ml | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-)LGTM. Thanks, -- Pino Toscano
Seemingly Similar Threads
- [PATCH] hivex: add hivex_set_value api call and perl bindings, tests
- [PATCH] lua, perl: Use thread-safe strerror_r instead of strerror (RHBZ#1536763).
- [PATCH] hivex: add hivex_set_value api call and ocaml/perl bindings, tests
- [PATCH] perl: use INT2PTR macro for casting back to guestfs_h * (RHBZ#1150298)
- [PATCH] Change wording from "twice" to "more than once" in error messages