]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-142595: Amend be5e0dcdedb (fix NULL pointer dereference) (GH-142775) (...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Dec 2025 10:12:43 +0000 (11:12 +0100)
committerGitHub <noreply@github.com>
Tue, 16 Dec 2025 10:12:43 +0000 (15:42 +0530)
gh-142595: Amend be5e0dcdedb (fix NULL pointer dereference) (GH-142775)
(cherry picked from commit 15a9762500b3d9a13206aa54d8695513efaf3b55)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Modules/_decimal/_decimal.c

index 49dc45a4aff5c7b67f7e481fcc2d0a87e40c7c2a..4516c7d847bdedac65620ddcab0f0e52f1669e50 100644 (file)
@@ -6040,8 +6040,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");