Avoid a dangling pointer.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@439 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
@@ -1824,15 +1824,12 @@ static int Parser_xmlNamespace(
|
|||||||
if (pCur->namespaceUri != NULL) {
|
if (pCur->namespaceUri != NULL) {
|
||||||
free(pCur->namespaceUri);
|
free(pCur->namespaceUri);
|
||||||
}
|
}
|
||||||
/* here it goes to segfault on "" when not copying */
|
pCur->namespaceUri = safe_strdup(newNode->nodeValue);
|
||||||
if (newNode->nodeValue){
|
|
||||||
pCur->namespaceUri = safe_strdup( newNode->nodeValue );
|
|
||||||
if (pCur->namespaceUri == NULL) {
|
if (pCur->namespaceUri == NULL) {
|
||||||
ret = IXML_INSUFFICIENT_MEMORY;
|
ret = IXML_INSUFFICIENT_MEMORY;
|
||||||
line = __LINE__;
|
line = __LINE__;
|
||||||
goto ExitFunction;
|
goto ExitFunction;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (strncmp(newNode->nodeName, "xmlns:", strlen("xmlns:")) == 0) {
|
} else if (strncmp(newNode->nodeName, "xmlns:", strlen("xmlns:")) == 0) {
|
||||||
/* namespace definition */
|
/* namespace definition */
|
||||||
ret = Parser_setNodePrefixAndLocalName(newNode);
|
ret = Parser_setNodePrefixAndLocalName(newNode);
|
||||||
|
|||||||
Reference in New Issue
Block a user