2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 06:45:14 +00:00

confile: don't leak memory in case multiple shmounts are set

Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32503
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2021-03-27 20:59:15 +01:00
parent 79d2f54fd5
commit 405b28a4de

View File

@@ -2280,7 +2280,10 @@ static int set_config_mount_auto(const char *key, const char *value,
if(!container_path)
return log_error_errno(-EINVAL, EINVAL, "Failed to copy shmounts container path");
free_disarm(lxc_conf->shmount.path_host);
lxc_conf->shmount.path_host = move_ptr(host_path);
free_disarm(lxc_conf->shmount.path_cont);
lxc_conf->shmount.path_cont = move_ptr(container_path);
}
}