patch from Dodji Seketeli to avoid a leak on repeated uses of

* xmlwriter.c: patch from Dodji Seketeli to avoid a leak on repeated
  uses of xmlTextWriterStartDocument()
Daniel

svn path=/trunk/; revision=3642
diff --git a/xmlwriter.c b/xmlwriter.c
index f618610..7acae76 100644
--- a/xmlwriter.c
+++ b/xmlwriter.c
@@ -545,7 +545,9 @@
 
     writer->out->encoder = encoder;
     if (encoder != NULL) {
-        writer->out->conv = xmlBufferCreateSize(4000);
+	if (writer->out->conv == NULL) {
+	    writer->out->conv = xmlBufferCreateSize(4000);
+	}
         xmlCharEncOutFunc(encoder, writer->out->conv, NULL);
         if ((writer->doc != NULL) && (writer->doc->encoding == NULL))
             writer->doc->encoding = xmlStrdup((xmlChar *)writer->out->encoder->name);