bugfix: memory leak and dir-creating not work

bugfix: free filecopy when create when recursive creating dir; bugfix: dir-creating not working