1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

python: Don't try to free const pointers.

This commit is contained in:
Jelmer Vernooij
2008-01-14 18:01:54 +01:00
parent 712274b9bd
commit b4754f4683

View File

@@ -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;");