diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2011-02-06 20:58:21 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-02-14 22:21:31 +0100 |
commit | 67100f255dba284bcbb5ce795355dad1cff35658 (patch) | |
tree | f343a1c2bb24b4a4cc965933b41e6d0271fe05fb /fs/btrfs/volumes.c | |
parent | btrfs: prevent heap corruption in btrfs_ioctl_space_info() (diff) | |
download | linux-67100f255dba284bcbb5ce795355dad1cff35658.tar.xz linux-67100f255dba284bcbb5ce795355dad1cff35658.zip |
Btrfs - Fix memory leak in btrfs_init_new_device()
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>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 7cad59353b09..dadaaa8005c8 100644 --- 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; |