fixes a small bug introduced in last commit and detected by valgrind.

* tree.c: fixes a small bug introduced in last commit and detected
  by valgrind.
Daniel
diff --git a/tree.c b/tree.c
index 135c92b..ad99092 100644
--- a/tree.c
+++ b/tree.c
@@ -6427,6 +6427,7 @@
 	    memcpy(rebuf, buf->content, buf->use);
 	    xmlFree(buf->content);
 	}
+	rebuf[buf->use] = 0;
     }
     if (rebuf == NULL) {
         xmlGenericError(xmlGenericErrorContext,