summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 84b3405bb9..73442be59d 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -203,7 +203,11 @@ sub PythonStruct($$$$)
$self->pidl("if (!strcmp(name, \"$e->{NAME}\")) {");
my $varname = "object->$e->{NAME}";
$self->indent;
- if ($e->{ORIGINAL}->{POINTERS} > 0) {
+ my $l = $e->{LEVELS}[0];
+ my $nl = GetNextLevel($e, $l);
+ 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 "SCALAR" and $nl->{TYPE} eq "string")) {
$self->pidl("talloc_free($varname);");
}
$self->ConvertObjectFromPython($env, $mem_ctx, $e, "value", $varname, "return -1;");