[3.12] gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566) (#126568)

gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566)
(cherry picked from commit 9ecd8f7f40)

Co-authored-by: Valery Fedorenko <federicovalenso@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-11-08 11:56:08 +01:00 committed by GitHub
parent a0866f4c81
commit fc1e9e606b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}