summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-08-26 17:50:13 +1000
committerAndrew Tridgell <tridge@samba.org>2010-08-26 22:50:20 +1000
commit9cb771a4a05b3c204a2b0626b22a29874919b3aa (patch)
tree7dcb803a543c3629506f6b25729539330fb9334b
parent331905216a22989973d00dbc612e90ffa010ff0e (diff)
downloadsamba-9cb771a4a05b3c204a2b0626b22a29874919b3aa.tar.gz
samba-9cb771a4a05b3c204a2b0626b22a29874919b3aa.tar.bz2
samba-9cb771a4a05b3c204a2b0626b22a29874919b3aa.zip
pidl-python: ensure we allocate ref ptrs before use
this fixes a crash on samba4.samr.python in the build farm
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm6
1 files changed, 5 insertions, 1 deletions
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;