Re: [xml] Segfaults on FreeBSD when using XPath....

        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...
        ctx = xmlXPathNewContext(doc);
        path = xmlXPathEvalExpression((const xmlChar
*)"id(\"calvin\")", ctx);
        printf("Document root element name is %s\n",

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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]