Commit 0668e029 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

files-reg: don't leak file_remap objects on error paths

CID undefined (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable rm going out of scope leaks the storage it points to.
Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 63443235
...@@ -264,6 +264,7 @@ static int open_remap_linked(struct reg_file_info *rfi, ...@@ -264,6 +264,7 @@ static int open_remap_linked(struct reg_file_info *rfi,
rfd = mntns_get_root_by_mnt_id(rfi->rfe->mnt_id); rfd = mntns_get_root_by_mnt_id(rfi->rfe->mnt_id);
if (fstatat(rfd, rrfi->path, &st, AT_SYMLINK_NOFOLLOW)) { if (fstatat(rfd, rrfi->path, &st, AT_SYMLINK_NOFOLLOW)) {
pr_perror("Can't get owner of link remap %s", rrfi->path); pr_perror("Can't get owner of link remap %s", rrfi->path);
xfree(rm);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment