From ad7148fec650c10fa77daf73ece57a8dfa37eb63 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 11 Jun 2015 09:58:13 +0200 Subject: [PATCH] pidl:Python: use discard_const() to pass a possible const pointer to talloc_unlink() Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index b634137cd5d..1d271bfa525 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -224,7 +224,7 @@ sub PythonStruct($$$$$$) if ($l->{TYPE} eq "POINTER" and not ($nl->{TYPE} eq "ARRAY" and ($nl->{IS_FIXED} or is_charset_array($e, $nl))) and not ($nl->{TYPE} eq "DATA" and Parse::Pidl::Typelist::scalar_is_reference($nl->{DATA_TYPE}))) { - $self->pidl("talloc_unlink(pytalloc_get_mem_ctx(py_obj), $varname);"); + $self->pidl("talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const($varname));"); } $self->ConvertObjectFromPython($env, $mem_ctx, $e, "value", $varname, "return -1;"); $self->pidl("return 0;"); -- 2.11.4.GIT