Skip to content

Commit fa4d8cd

Browse files
committed
Cleanup create_notation()
We're already clearing memory, and we can merge the declaration and assignment.
1 parent aa19461 commit fa4d8cd

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

ext/dom/dom_iterators.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,13 @@ static void itemHashScanner (void *payload, void *data, xmlChar *name)
5252

5353
xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) /* {{{ */
5454
{
55-
xmlEntityPtr ret;
56-
57-
ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
55+
xmlEntityPtr ret = xmlMalloc(sizeof(xmlEntity));
5856
memset(ret, 0, sizeof(xmlEntity));
5957
ret->type = XML_NOTATION_NODE;
6058
ret->name = xmlStrdup(name);
6159
ret->ExternalID = xmlStrdup(ExternalID);
6260
ret->SystemID = xmlStrdup(SystemID);
63-
ret->length = 0;
64-
ret->content = NULL;
65-
ret->URI = NULL;
66-
ret->orig = NULL;
67-
ret->children = NULL;
68-
ret->parent = NULL;
69-
ret->doc = NULL;
70-
ret->_private = NULL;
71-
ret->last = NULL;
72-
ret->prev = NULL;
73-
return((xmlNodePtr) ret);
61+
return (xmlNodePtr) ret;
7462
}
7563
/* }}} */
7664

0 commit comments

Comments
 (0)