fixed a bug exposed by Rob Richards in the mailing-list added the

* relaxng.c: fixed a bug exposed by Rob Richards in the mailing-list
* result//compare0* test//compare0*: added the regression test in
  the suite as this went unnoticed !
Daniel
diff --git a/relaxng.c b/relaxng.c
index cd28034..41c899b 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -2573,11 +2573,11 @@
     }
     ret = xmlSchemaValPredefTypeNode(typ, value2, &res2, ctxt2);
     if (ret != 0) {
-        xmlSchemaFreeValue(res1);
+	if ((comp1 == NULL) && (res1 != NULL))
+	    xmlSchemaFreeValue(res1);
         return (-1);
     }
     if (res1 == NULL) {
-        xmlSchemaFreeValue(res1);
         return (-1);
     }
     ret = xmlSchemaCompareValues(res1, res2);