libxml: Fix compilation error with gcc < 10 (regression 2023-05-26).

* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Add braces.
This commit is contained in:
Bruno Haible 2023-05-29 11:41:07 +02:00
parent c547620069
commit 36cc99cdc6

View File

@ -9514,25 +9514,27 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/*
* Attributes (xmlAttr).
*/
xmlAttrPtr cloneAttr = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
if (cloneAttr == NULL) {
xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node");
goto internal_error;
}
memset(cloneAttr, 0, sizeof(xmlAttr));
/*
* Set hierachical links.
* TODO: Change this to add to the end of attributes.
*/
if (resultClone != NULL) {
cloneAttr->parent = parentClone;
if (prevClone) {
prevClone->next = (xmlNodePtr) cloneAttr;
cloneAttr->prev = (xmlAttrPtr) prevClone;
{
xmlAttrPtr cloneAttr = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
if (cloneAttr == NULL) {
xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node");
goto internal_error;
}
memset(cloneAttr, 0, sizeof(xmlAttr));
/*
* Set hierachical links.
* TODO: Change this to add to the end of attributes.
*/
if (resultClone != NULL) {
cloneAttr->parent = parentClone;
if (prevClone) {
prevClone->next = (xmlNodePtr) cloneAttr;
cloneAttr->prev = (xmlAttrPtr) prevClone;
} else
parentClone->properties = (xmlAttrPtr) cloneAttr;
} else
parentClone->properties = (xmlAttrPtr) cloneAttr;
} else
resultClone = (xmlNodePtr) cloneAttr;
resultClone = (xmlNodePtr) cloneAttr;
}
break;
default:
/*