bpo-29802: Fix reference counting in module-level struct functions (#1213)

when pass arguments of wrong type.
This commit is contained in:
Serhiy Storchaka 2017-04-20 21:19:31 +03:00 committed by GitHub
parent 8f5cdfa9fc
commit 40db90c1ce
4 changed files with 15 additions and 0 deletions

View file

@ -2083,6 +2083,7 @@ cache_struct_converter(PyObject *fmt, PyObject **ptr)
if (fmt == NULL) {
Py_DECREF(*ptr);
*ptr = NULL;
return 1;
}