projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51788b1
)
Btrfs - Fix memory leak in btrfs_init_new_device()
author
Ilya Dryomov
<idryomov@gmail.com>
Sun, 6 Feb 2011 19:58:21 +0000
(19:58 +0000)
committer
Chris Mason
<chris.mason@oracle.com>
Mon, 14 Feb 2011 21:21:31 +0000
(16:21 -0500)
Memory allocated by calling kstrdup() should be freed.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/volumes.c
b/fs/btrfs/volumes.c
index 7cad59353b09c4fdf0cb80072e109bf0f9db7165..dadaaa8005c8227723c87ff01043040f9a458aa1 100644
(file)
--- a/
fs/btrfs/volumes.c
+++ b/
fs/btrfs/volumes.c
@@
-1603,12
+1603,14
@@
int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
ret = find_next_devid(root, &device->devid);
if (ret) {
+ kfree(device->name);
kfree(device);
goto error;
}
trans = btrfs_start_transaction(root, 0);
if (IS_ERR(trans)) {
+ kfree(device->name);
kfree(device);
ret = PTR_ERR(trans);
goto error;