From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:00:40 +0000 (+0100) Subject: [3.13] gh-142595: Amend be5e0dcdedb (fix NULL pointer dereference) (GH-142775) (GH... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4480f5b6619b80d562b35d1267221cc6ecdad6b5;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-142595: Amend be5e0dcdedb (fix NULL pointer dereference) (GH-142775) (GH-142789) (cherry picked from commit 15a9762500b3d9a13206aa54d8695513efaf3b55) Co-authored-by: Sergey B Kirpichev Co-authored-by: Kumar Aditya --- diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 9736e71efbbe..59ee32ab7707 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -5922,8 +5922,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");