Re: [xml] Segfaults on FreeBSD when using XPath....
- From: David Frascone <dave frascone com>
- To: Gabriel Ambuehl <gabriel_ambuehl buz ch>
- Cc: xml xmlsoft org
- Subject: Re: [xml] Segfaults on FreeBSD when using XPath....
- Date: Thu, 7 Jun 2001 14:21:48 -0500
doc = xmlParseFile(argv[1]);
printf("mem used =%d\n", xmlMemUsed());
/* xmlMemDisplay(stdout); */
root = xmlDocGetRootElement(doc);
printf("Document root element name is %s\n", root->name);
/*
* Try to find root element using xpath...
*/
xmlXPathInit();
ctx = xmlXPathNewContext(doc);
path = xmlXPathEvalExpression((const xmlChar
*)"id(\"calvin\")", ctx);
printf("Document root element name is %s\n",
path->nodesetval->nodeTab[0]->name);
Running it in a debugger shows that path->nodesetval->nodeTab is NULL.
You should probably check all pointers for NULL before you attempt to de-
reference them.
-Dave
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]