From 54e2a5e80bddc970418fdcb4ce509116673a299d Mon Sep 17 00:00:00 2001 From: Valery Fedorenko Date: Fri, 8 Nov 2024 13:19:15 +0300 Subject: [PATCH] gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566) (cherry picked from commit 9ecd8f7f40e6724a1c1d46c2665147aaabceb2d2) Co-authored-by: Valery Fedorenko --- Python/import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/import.c b/Python/import.c index db70909982fa3e..4d0b7fd95569b3 100644 --- a/Python/import.c +++ b/Python/import.c @@ -3539,7 +3539,7 @@ _imp_find_frozen_impl(PyObject *module, PyObject *name, int withdata) if (info.origname != NULL && info.origname[0] != '\0') { origname = PyUnicode_FromString(info.origname); if (origname == NULL) { - Py_DECREF(data); + Py_XDECREF(data); return NULL; } }