diff -Naur a/relaxng.c b/relaxng.c
--- a/relaxng.c	2013-08-03 14:27:41.000000000 +0530
+++ b/relaxng.c	2013-08-03 14:34:35.000000000 +0530
@@ -2599,9 +2599,6 @@
 	    xmlSchemaFreeValue(res1);
         return (-1);
     }
-    if (res1 == NULL) {
-        return (-1);
-    }
     ret = xmlSchemaCompareValues(res1, res2);
     if (res1 != (xmlSchemaValPtr) comp1)
         xmlSchemaFreeValue(res1);
