Completely changed the way the XPath evaluation is done, likely to break
stuff like libxslt right now:
- Makefile.am: detect XPath memleaks in regreson tests
- error.c: fixed and error w.r.t. error reporting still using
  stderr
- hash.c: added new line at end of file
- tree.h: minor cleanup
- xpath.[ch] xpointer.[ch]: Major changes ! Separated XPath
  expression parsing from evaluation, resulted in a number of
  changes internally, and in XPointer. Likely to break stuff
  using xpathInternals.h but should remain binary compatible,
  new interfaces will be added.
Daniel
diff --git a/error.c b/error.c
index 2674738..a30530e 100644
--- a/error.c
+++ b/error.c
@@ -214,7 +214,8 @@
     str = xmlGetVarStr(msg, args);
     va_end(args);
     xmlGenericError(xmlGenericErrorContext, str);
-    xmlFree(str);
+    if (str != NULL)
+	xmlFree(str);
 
     if (ctxt != NULL) {
 	xmlParserPrintFileContext(input);
@@ -259,7 +260,8 @@
     str = xmlGetVarStr(msg, args);
     va_end(args);
     xmlGenericError(xmlGenericErrorContext, str);
-    xmlFree(str);
+    if (str != NULL)
+	xmlFree(str);
 
     if (ctxt != NULL) {
 	xmlParserPrintFileContext(input);
@@ -291,6 +293,7 @@
 {
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlParserInputPtr input = NULL;
+    char * str;
     va_list args;
 
     if (ctxt != NULL) {
@@ -303,8 +306,11 @@
 
     xmlGenericError(xmlGenericErrorContext, "validity error: ");
     va_start(args, msg);
-    vfprintf(xmlGenericErrorContext, msg, args);
+    str = xmlGetVarStr(msg, args);
     va_end(args);
+    xmlGenericError(xmlGenericErrorContext, str);
+    if (str != NULL)
+	xmlFree(str);
 
     if (ctxt != NULL) {
 	xmlParserPrintFileContext(input);
@@ -325,6 +331,7 @@
 {
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlParserInputPtr input = NULL;
+    char * str;
     va_list args;
 
     if (ctxt != NULL) {
@@ -337,8 +344,11 @@
         
     xmlGenericError(xmlGenericErrorContext, "validity warning: ");
     va_start(args, msg);
-    vfprintf(xmlGenericErrorContext, msg, args);
+    str = xmlGetVarStr(msg, args);
     va_end(args);
+    xmlGenericError(xmlGenericErrorContext, str);
+    if (str != NULL)
+	xmlFree(str);
 
     if (ctxt != NULL) {
 	xmlParserPrintFileContext(input);