From: Christian Brauner Date: Sat, 27 Mar 2021 19:59:15 +0000 (+0100) Subject: confile: don't leak memory in case multiple shmounts are set X-Git-Tag: lxc-5.0.0~235^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=405b28a4de42c15a060ecb95b63fcee08b98885b;p=thirdparty%2Flxc.git 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 --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index d53c4f880..1decb0bc5 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -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); } }