diff --git a/source/fs/mufs/path.c b/source/fs/mufs/path.c index 21b5215..7f59eb5 100644 --- a/source/fs/mufs/path.c +++ b/source/fs/mufs/path.c @@ -194,7 +194,7 @@ int mufs_rename(struct mufs *fs, const char *old, const char *new) free(path); if (ret < 0) - return -1; + goto err_del_subtree; type = stat.type; @@ -204,6 +204,7 @@ int mufs_rename(struct mufs *fs, const char *old, const char *new) if (mufs_rmpath(fs, old) < 0) goto err_del_subtree; + mufs_del_tree(subtree); return 0; err_del_subtree: