From 828af07ccb2d67d2b6d12a371ddcaddcd56916bb Mon Sep 17 00:00:00 2001 From: Andrew Vagin Date: Thu, 29 Oct 2015 14:32:12 +0300 Subject: [PATCH] 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. --- files-reg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/files-reg.c b/files-reg.c index 59d88ca426..597d9ae9f4 100644 --- a/files-reg.c +++ b/files-reg.c @@ -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); if (fstatat(rfd, rrfi->path, &st, AT_SYMLINK_NOFOLLOW)) { pr_perror("Can't get owner of link remap %s", rrfi->path); + xfree(rm); return -1; }