]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pidl:Python: check PyTuple_New() return value
authorStefan Metzmacher <metze@samba.org>
Tue, 28 Jan 2025 09:20:08 +0000 (10:20 +0100)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 29 Jan 2025 01:14:40 +0000 (01:14 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14213

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
pidl/lib/Parse/Pidl/Samba4/Python.pm

index 664faa3d20990de779c011b41e28f1a44394cc00..253bac1e9bdf1223048502efe614ffc4ccabbf87 100644 (file)
@@ -1042,6 +1042,12 @@ sub PythonFunctionUnpackOut($$$)
 
        if ($result_size > 1) {
                $self->pidl("result = PyTuple_New($result_size);");
+               $self->pidl("if (result == NULL) {");
+               $self->indent;
+               $self->pidl("return NULL;");
+               $self->deindent;
+               $self->pidl("}");
+               $self->pidl("");
                $signature .= "(";
        } elsif ($result_size == 0) {
                $self->pidl("result = Py_None;");