]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142595: Amend be5e0dcdedb (fix NULL pointer dereference) (GH-142775)
authorSergey B Kirpichev <skirpichev@gmail.com>
Tue, 16 Dec 2025 08:52:20 +0000 (11:52 +0300)
committerGitHub <noreply@github.com>
Tue, 16 Dec 2025 08:52:20 +0000 (10:52 +0200)
Modules/_decimal/_decimal.c

index 6ed8c0f3beb27767c9a03552c3d442d10cf01f12..e183c70653b0d4505db2a0aca64716a8059f6e4b 100644 (file)
@@ -7753,8 +7753,9 @@ _decimal_exec(PyObject *m)
 
     /* DecimalTuple */
     ASSIGN_PTR(collections, PyImport_ImportModule("collections"));
-    obj = PyObject_CallMethod(collections, "namedtuple", "(ss)", "DecimalTuple",
-                              "sign digits exponent");
+    ASSIGN_PTR(obj, PyObject_CallMethod(collections, "namedtuple", "(ss)",
+                                        "DecimalTuple",
+                                        "sign digits exponent"));
     if (!PyType_Check(obj)) {
         PyErr_SetString(PyExc_TypeError,
                         "type is expected from namedtuple call");