From: Xiang Zhang Date: Wed, 22 Mar 2017 04:25:51 +0000 (+0800) Subject: bpo-29873: fix INCREF for possible NULL value in element_getattr() (GH-757) X-Git-Tag: v2.7.14rc1~242 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=827c78326aa850257ca40991b401b3db298c54fb;p=python bpo-29873: fix INCREF for possible NULL value in element_getattr() (GH-757) --- diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index b01167b8a0..7a0aeda63c 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -1542,7 +1542,7 @@ element_getattr(ElementObject* self, char* name) return res; } else if (strcmp(name, "text") == 0) { res = element_get_text(self); - Py_INCREF(res); + Py_XINCREF(res); return res; }