From 40db90c1ce1a59d5f5f2894bb0ce32110000bf27 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 20 Apr 2017 21:19:31 +0300 Subject: bpo-29802: Fix reference counting in module-level struct functions (#1213) when pass arguments of wrong type. --- Modules/_struct.c | 1 + 1 file changed, 1 insertion(+) (limited to 'Modules/_struct.c') 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; } -- cgit v1.2.1