From: Eli Bendersky Date: Wed, 4 Apr 2012 12:55:07 +0000 (+0300) Subject: Fix Windows compilation errors X-Git-Tag: v3.3.0a3~316 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08b852970e6aae818a7fb398abcf8135fe19ec3a;p=python Fix Windows compilation errors --- diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 5425269c1a..c5bbc80868 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -264,17 +264,19 @@ create_extra(ElementObject* self, PyObject* attrib) LOCAL(void) dealloc_extra(ElementObject* self) { + ElementObjectExtra *myextra; + int i; + if (!self->extra) return; /* Avoid DECREFs calling into this code again (cycles, etc.) */ - ElementObjectExtra *myextra = self->extra; + myextra = self->extra; self->extra = NULL; Py_DECREF(myextra->attrib); - int i; for (i = 0; i < myextra->length; i++) Py_DECREF(myextra->children[i]);