Commit 22e4b655 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Detect buffers with "empty" content and just delete "empty" content. JM-1088

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches@8603 b35dd754-fafc-0310-a699-88a17e54d16e
parent 53a0b710
......@@ -156,6 +156,14 @@ class XMLLightweightParser {
char[] buf = charBuffer.array();
buffer.append(buf);
// Do nothing if the buffer only contains white spaces
if (' ' == buffer.charAt(0) && ' ' == buffer.charAt(buffer.length()-1)) {
if ("".equals(buffer.toString().trim())) {
// Empty the buffer so there is no memory leak
buffer.delete(0, buffer.length());
return;
}
}
// Robot.
char ch;
for (int i = 0; i < readByte; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment