* [PATCH] Btrfs - Fix memory leak in btrfs_init_new_device()
@ 2011-02-06 19:58 Ilya Dryomov
0 siblings, 0 replies; only message in thread
From: Ilya Dryomov @ 2011-02-06 19:58 UTC (permalink / raw)
To: linux-btrfs; +Cc: Chris Mason
Memory allocated by calling kstrdup() should be freed.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
fs/btrfs/volumes.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d158530..9649cdd 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1601,6 +1601,7 @@ 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;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-06 19:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-06 19:58 [PATCH] Btrfs - Fix memory leak in btrfs_init_new_device() Ilya Dryomov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).