summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-14 18:01:54 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-14 19:53:08 +0100
commit994e43e9ebd3922f2c3378edf0e73e912815230a (patch)
tree67b6ff2bdb2d491d3d85d0ac365712f9629c3dd7
parent860106b3f426a06eed6a681fa839dd89f339ba9a (diff)
downloadsamba-994e43e9ebd3922f2c3378edf0e73e912815230a.tar.gz
samba-994e43e9ebd3922f2c3378edf0e73e912815230a.tar.bz2
samba-994e43e9ebd3922f2c3378edf0e73e912815230a.zip
python: Don't try to free const pointers.
(This used to be commit b4754f4683e67a940f18a88e45c0878259f45b97)
-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;");