fix an XML Schemas crash raised by Stefan Behnel when testing with W3C

* xmlschemas.c: fix an XML Schemas crash raised by Stefan Behnel
  when testing with W3C test suite
Daniel

svn path=/trunk/; revision=3712
diff --git a/xmlschemas.c b/xmlschemas.c
index 13c22ca..01a9c3c 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -21808,9 +21808,9 @@
 		return (1);
 	    }
 	    if (xmlSchemaGetNotation(schema, localName, nsName) != NULL) {
-		if (valNeeded && (val != NULL)) {
-		    (*val) = xmlSchemaNewNOTATIONValue(BAD_CAST localName,
-			BAD_CAST xmlStrdup(nsName));
+		if ((valNeeded) && (val != NULL)) {
+		    (*val) = xmlSchemaNewNOTATIONValue(xmlStrdup(localName),
+						       xmlStrdup(nsName));
 		    if (*val == NULL)
 			ret = -1;
 		}