OSDN Git Service
(root)
/
android-x86
/
external-exfat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bf2c77
)
Fix clusters loss when file renaming replaces target.
author
relan
<relan@users.noreply.github.com>
Sat, 19 Dec 2015 08:16:21 +0000
(11:16 +0300)
committer
relan
<relan@users.noreply.github.com>
Sat, 19 Dec 2015 08:16:21 +0000
(11:16 +0300)
Add missing exfat_cleanup_node() call after exfat_unlink().
libexfat/node.c
patch
|
blob
|
history
diff --git
a/libexfat/node.c
b/libexfat/node.c
index
d05f20d
..
4dd4dc6
100644
(file)
--- a/
libexfat/node.c
+++ b/
libexfat/node.c
@@
-1130,6
+1130,16
@@
int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path)
exfat_put_node(ef, existing);
if (rc != 0)
{
+ /* free clusters even if something went wrong; overwise they
+ will be just lost */
+ exfat_cleanup_node(ef, existing);
+ exfat_put_node(ef, dir);
+ exfat_put_node(ef, node);
+ return rc;
+ }
+ rc = exfat_cleanup_node(ef, existing);
+ if (rc != 0)
+ {
exfat_put_node(ef, dir);
exfat_put_node(ef, node);
return rc;