Fixed Bug #7158

http://hercules.ws/board/tracker/issue-7158-memory-leak/
Signed-off-by: shennetsind <ind@henn.et>