Removed duplicate code and fixed a memory leak on a failed stream write
Removed duplicate code and fixed a memory leak on a failed stream write

tacketar/lstore,accre/lstore,PerilousApricot/lstore,accre/lstore,PerilousApricot/lstore,PerilousApricot/lstore,accre/lstore,tacketar/lstore,tacketar/lstore,tacketar/lstore,PerilousApricot/lstore,accre/lstore