Fix memory leak when doc is NULL
* xmlschemas.c: fix memory leak when doc is NULL
diff --git a/xmlschemas.c b/xmlschemas.c
index 56c65e3..9c86c75 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -10531,9 +10531,9 @@
 	    /* Parse from memory buffer. */
 	    doc = xmlCtxtReadMemory(parserCtxt, schemaBuffer, schemaBufferLen,
 		NULL, NULL, SCHEMAS_PARSE_OPTIONS);
-	    schemaLocation = xmlStrdup(BAD_CAST "in_memory_buffer");
+	    schemaLocation = BAD_CAST "in_memory_buffer";
 	    if (doc != NULL)
-		doc->URL = schemaLocation;
+		doc->URL = xmlStrdup(schemaLocation);
 	}
 	/*
 	* For <import>: