Skip to content

Commit 827c783

Browse files
authored
bpo-29873: fix INCREF for possible NULL value in element_getattr() (GH-757)
1 parent 91f79db commit 827c783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_elementtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ element_getattr(ElementObject* self, char* name)
15421542
return res;
15431543
} else if (strcmp(name, "text") == 0) {
15441544
res = element_get_text(self);
1545-
Py_INCREF(res);
1545+
Py_XINCREF(res);
15461546
return res;
15471547
}
15481548

0 commit comments

Comments
 (0)