confile: don't leak memory when overwriting lxc.rootfs.options

parent b4d341d7
......@@ -2465,6 +2465,10 @@ static int set_config_rootfs_options(const char *key, const char *value,
struct lxc_rootfs *rootfs = &lxc_conf->rootfs;
int ret;
clr_config_rootfs_options(key, lxc_conf, data);
if (lxc_config_value_empty(value))
return 0;
ret = parse_mntopts(value, &mflags, &mdata);
if (ret < 0)
return ret_errno(EINVAL);
......@@ -2477,9 +2481,9 @@ static int set_config_rootfs_options(const char *key, const char *value,
if (ret < 0)
return ret_errno(ENOMEM);
rootfs->mountflags = mflags | pflags;
rootfs->options = move_ptr(opts);
rootfs->data = move_ptr(mdata);
rootfs->mountflags = mflags | pflags;
rootfs->options = move_ptr(opts);
rootfs->data = move_ptr(mdata);
return 0;
}
......
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