[PATCH 12/17] btrfs-progs: free allocated di_args in cmd_start_replace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We only freed this allocation in error paths, and leaked
a bit when it went out of scope normally.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---
 cmds-replace.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/cmds-replace.c b/cmds-replace.c
index 9397396..4cc32df 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -228,6 +228,7 @@ static int cmd_start_replace(int argc, char **argv)
 		for (i = 0; i < fi_args.num_devices; i++)
 			if (start_args.start.srcdevid == di_args[i].devid)
 				break;
+		free(di_args);
 		if (i == fi_args.num_devices) {
 			fprintf(stderr, "Error: '%s' is not a valid devid for filesystem '%s'\n",
 				srcdev, path);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux