diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-07-26 07:58:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 07:58:07 (GMT) |
commit | 36208b5f6aecf40c325667385cc3afd389efab88 (patch) | |
tree | 389f9e02678df7a9a6758bd59fc76656df1b91bb /Modules | |
parent | 9fa44d7a3045f4571e2cabd53a1cc0f16a0f3723 (diff) | |
download | cpython-36208b5f6aecf40c325667385cc3afd389efab88.zip cpython-36208b5f6aecf40c325667385cc3afd389efab88.tar.gz cpython-36208b5f6aecf40c325667385cc3afd389efab88.tar.bz2 |
[3.11] gh-106350: Tkinter: do not ignore return value of `mp_init()` (GH-106351) (GH-107259)
(cherry picked from commit b5ae7c498438657a6ba0bf4cc216b9c2c93a06c7)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 2aab68e..e537707 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -906,8 +906,9 @@ asBignumObj(PyObject *value) return NULL; } hexchars += neg + 2; /* skip sign and "0x" */ - mp_init(&bigValue); - if (mp_read_radix(&bigValue, hexchars, 16) != MP_OKAY) { + if (mp_init(&bigValue) != MP_OKAY || + mp_read_radix(&bigValue, hexchars, 16) != MP_OKAY) + { mp_clear(&bigValue); Py_DECREF(hexstr); PyErr_NoMemory(); |