After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346202 - Misunderstanding of xmlXPathCastToString() behaviour
Misunderstanding of xmlXPathCastToString() behaviour
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: docs
2.6.x
Other All
: Normal normal
: ---
Assigned To: kbuchcik
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-29 12:54 UTC by Ungrund
Modified: 2006-08-15 13:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ungrund 2006-06-29 12:54:54 UTC
Documentation 
Section: libxml-xpath
Returns: the string value of the object, NULL in case of error. A new string is allocated only if needed (@val isn't a string object). 

Correct version:
Returns: the allocated string value of the object, NULL in case of error.
It's up to the caller to free the string memory with xmlFree().


Other information:
If we look at source code, we can see:
...
case XPATH_STRING:
     return(xmlStrdup(val->stringval));
...

So, xmlStrdup() will be called in any case, even when @val is string object.
Comment 1 kbuchcik 2006-08-15 13:06:45 UTC
Right. Committed your fix to the CVS HEAD.

Thanks for the report and sorry that it took so long to process it!