StringStream's memory leak

This should correct the problem of memory's leak in StringStream