btrfs-progs: free allocated di_args in cmd_start_replace

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@redhat.com>
This commit is contained in:
Eric Sandeen 2013-02-25 16:54:45 -06:00 committed by David Sterba
parent 3d118fe6c4
commit 1b12f5c9f7
1 changed files with 1 additions and 0 deletions

View File

@ -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);