From: Serge Hallyn Date: Wed, 18 Jun 2014 23:01:50 +0000 (-0500) Subject: clone: make sure to update the rootfs path in unexpanded conf X-Git-Tag: lxc-1.1.0.alpha1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d021832111871f46bbce7edb0806944b4247b5d0;p=thirdparty%2Flxc.git clone: make sure to update the rootfs path in unexpanded conf Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 20bf60092..3d1cf3458 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2546,6 +2546,12 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c, ERROR("Out of memory while setting storage path"); return -1; } + free(c->lxc_unexp_conf->rootfs.path); + c->lxc_unexp_conf->rootfs.path = strdup(c->lxc_conf->rootfs.path); + if (!c->lxc_unexp_conf->rootfs.path) { + ERROR("Out of memory while setting storage path"); + return -1; + } if (flags & LXC_CLONE_SNAPSHOT) copy_rdepends(c, c0); if (need_rdep) {