From 9cb771a4a05b3c204a2b0626b22a29874919b3aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 Aug 2010 17:50:13 +1000 Subject: pidl-python: ensure we allocate ref ptrs before use this fixes a crash on samba4.samr.python in the build farm --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index eb39718bb5..05c11be07f 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -947,7 +947,11 @@ sub ConvertObjectFromPythonLevel($$$$$$$$$) } # if we want to handle more than one level of pointer in python interfaces # then this is where we would need to allocate it - $self->pidl("$var_name = NULL;"); + if ($l->{POINTER_TYPE} eq "ref") { + $self->pidl("$var_name = talloc_ptrtype($mem_ctx, $var_name);"); + } else { + $self->pidl("$var_name = NULL;"); + } $self->ConvertObjectFromPythonLevel($env, $mem_ctx, $mem_ref, $py_var, $e, $nl, get_value_of($var_name), $fail); if ($l->{POINTER_TYPE} ne "ref") { $self->deindent; -- cgit