summaryrefslogtreecommitdiff
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-20 21:19:31 +0300
committerGitHub <noreply@github.com>2017-04-20 21:19:31 +0300
commit40db90c1ce1a59d5f5f2894bb0ce32110000bf27 (patch)
tree0436658cf04e8ebd902a9bc1851b21ee7b98bf45 /Modules/_struct.c
parent8f5cdfa9fc1bb6b4d9a33fc281987252f6398430 (diff)
downloadcpython-git-40db90c1ce1a59d5f5f2894bb0ce32110000bf27.tar.gz
bpo-29802: Fix reference counting in module-level struct functions (#1213)
when pass arguments of wrong type.
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 4bc4186923..a614be89d2 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -2083,6 +2083,7 @@ cache_struct_converter(PyObject *fmt, PyObject **ptr)
if (fmt == NULL) {
Py_DECREF(*ptr);
+ *ptr = NULL;
return 1;
}