From 3649151a9f1b5a730f600c5f08dba5eb6cdbeaf1 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Wed, 14 Jun 2017 13:52:34 +0200 Subject: [PATCH] mufs: properly free the tree object in mufs_rename() --- source/fs/mufs/path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: