]> 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)
committerJule Anger <janger@samba.org>
Mon, 3 Feb 2025 14:53:10 +0000 (14:53 +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>
(cherry picked from commit f7282c0dffbf30d72051a81d46d831344a9bbcf9)

pidl/lib/Parse/Pidl/Samba4/Python.pm

index e024b19a19adab31528f8ff235044cb816bdee77..efa5fa83e7323139e166cf38b0db902051425c85 100644 (file)
@@ -992,6 +992,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;");