From a6ba868e58ddff5a695cddea8ca522ad831c4fdb Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Thu, 12 Jun 2008 13:58:08 +0000 Subject: [PATCH] Avoid a dangling pointer. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@439 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- ixml/src/ixmlparser.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ixml/src/ixmlparser.c b/ixml/src/ixmlparser.c index 2d4e52a..4758b9f 100644 --- a/ixml/src/ixmlparser.c +++ b/ixml/src/ixmlparser.c @@ -1824,14 +1824,11 @@ static int Parser_xmlNamespace( if (pCur->namespaceUri != NULL) { free(pCur->namespaceUri); } - /* here it goes to segfault on "" when not copying */ - if (newNode->nodeValue){ - pCur->namespaceUri = safe_strdup( newNode->nodeValue ); - if (pCur->namespaceUri == NULL) { - ret = IXML_INSUFFICIENT_MEMORY; - line = __LINE__; - goto ExitFunction; - } + pCur->namespaceUri = safe_strdup(newNode->nodeValue); + if (pCur->namespaceUri == NULL) { + ret = IXML_INSUFFICIENT_MEMORY; + line = __LINE__; + goto ExitFunction; } } else if (strncmp(newNode->nodeName, "xmlns:", strlen("xmlns:")) == 0) { /* namespace definition */