=== modified file 'libxslt/pattern.c'
--- old/libxslt/pattern.c	2008-05-09 12:35:41 +0000
+++ new/libxslt/pattern.c	2008-09-09 18:29:10 +0000
@@ -1416,7 +1416,7 @@
 
     *prefix = NULL;
     ret = xsltScanNCName(ctxt);
-    if (CUR == ':') {
+    if (ret && CUR == ':') {
         *prefix = ret;
 	NEXT;
 	ret = xsltScanNCName(ctxt);
@@ -1665,6 +1665,7 @@
 		xsltTransformError(NULL, NULL, NULL,
 	    "xsltCompileStepPattern : no namespace bound to prefix %s\n",
 				 prefix);
+		xmlFree(prefix);
 		ctxt->error = 1;
 		goto error;
 	    } else {
