btrfs-progs: restore: fix path leak in copy_metadata
authorDavid Sterba <dsterba@suse.cz>
Thu, 23 Apr 2015 14:40:07 +0000 (16:40 +0200)
committerDavid Sterba <dsterba@suse.cz>
Fri, 24 Apr 2015 13:42:05 +0000 (15:42 +0200)
The path lifecycle spans only this function and we have to free it.

Resolves-coverity-id: 1295367
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-restore.c

index 44581df..808d1f1 100644 (file)
@@ -612,7 +612,7 @@ static int copy_metadata(struct btrfs_root *root, int fd,
                }
        }
 out:
-       btrfs_release_path(path);
+       btrfs_free_path(path);
        return ret;
 }