fix a nasty problem with reading over the end fix a reported memory leak

* xmlreader.c: fix a nasty problem with reading over the end
* xmlsave.c: fix a reported memory leak apparently
Daniel
diff --git a/xmlsave.c b/xmlsave.c
index 1a60a31..6e31416 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -179,6 +179,8 @@
     if (ctxt == NULL) return;
     if (ctxt->encoding != NULL)
         xmlFree((char *) ctxt->encoding);
+    if (ctxt->buf != NULL)
+        xmlOutputBufferClose(ctxt->buf);
     xmlFree(ctxt);
 }