diff options
author | Martin <gzlist@googlemail.com> | 2009-09-17 09:59:42 +0200 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2009-09-17 09:59:42 +0200 |
commit | a3a1d4891c0e28bb1a43582b2aef4a637fe97cfc (patch) | |
tree | c052505e7e1780ed670fb4ad1a466a4c72452148 | |
parent | 7089a62b8f133b42a2981cf1f920a8b3fe9a8caa (diff) | |
download | libxslt-a3a1d4891c0e28bb1a43582b2aef4a637fe97cfc.tar.gz |
QName parsing fix for patterns
* libxslt/pattern.c: fix a corner case and avoid a memory leak on
error
-rw-r--r-- | libxslt/pattern.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 815013b0..c4353679 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -1420,7 +1420,7 @@ xsltScanQName(xsltParserContextPtr ctxt, xmlChar **prefix) { *prefix = NULL; ret = xsltScanNCName(ctxt); - if (CUR == ':') { + if (ret && CUR == ':') { *prefix = ret; NEXT; ret = xsltScanNCName(ctxt); @@ -1669,6 +1669,7 @@ xsltCompileStepPattern(xsltParserContextPtr ctxt, xmlChar *token, int novar) { xsltTransformError(NULL, NULL, NULL, "xsltCompileStepPattern : no namespace bound to prefix %s\n", prefix); + xmlFree(prefix); ctxt->error = 1; goto error; } else { |