From b3a5d2814b3b25eb7d004fbb038bea3d8cf3e378 Mon Sep 17 00:00:00 2001 From: Alexander Mikhalitsyn Date: Tue, 29 Jul 2025 12:41:11 +0200 Subject: [PATCH] lxc/conf: do not leak opts.data memory in __lxc_idmapped_mounts_child() Fixes: Coverity 1641425 Signed-off-by: Alexander Mikhalitsyn --- src/lxc/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 6c0e3d3c9..1899b2806 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2682,11 +2682,11 @@ static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f) ret = parse_lxc_mount_attrs(&opts, mntent.mnt_opts); if (ret < 0) return syserror("Failed to parse LXC specific mount options"); - __data = opts.data; ret = parse_mount_attrs(&opts, mntent.mnt_opts); if (ret < 0) return syserror("Failed to parse mount options"); + __data = opts.data; /* No idmapped mount entry so skip it. */ if (is_empty_string(opts.userns_path)) -- 2.47.2