bpo-29876: fix DECREF for NULL value in subelement() (GH-760)

diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 7a0aeda..94dc5b7 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -524,8 +524,9 @@
     }
 
     elem = element_new(tag, attrib);
-
     Py_DECREF(attrib);
+    if (elem == NULL)
+        return NULL;
 
     if (element_add_subelement(parent, elem) < 0) {
         Py_DECREF(elem);