[PATCH] dwrite: Fix some memory leaks (Coverity).