[PATCH] fix for memory leak in write-tree.c