Commit 9d65a487 by KATOH Yasufumi Committed by Stéphane Graber

Fix segfault on lxc-create when no template specified

When no template file is specified on lxc-create, recieve segfault. So change not to append header in config when no template is specified. Signed-off-by: 's avatarKATOH Yasufumi <karma@jazz.email.ne.jp> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 47b6e6cf
...@@ -1089,10 +1089,12 @@ static bool lxcapi_create(struct lxc_container *c, const char *t, ...@@ -1089,10 +1089,12 @@ static bool lxcapi_create(struct lxc_container *c, const char *t,
lxc_conf_free(c->lxc_conf); lxc_conf_free(c->lxc_conf);
c->lxc_conf = NULL; c->lxc_conf = NULL;
if (t) {
if (!prepend_lxc_header(c->configfile, tpath, argv)) { if (!prepend_lxc_header(c->configfile, tpath, argv)) {
ERROR("Error prepending header to configuration file"); ERROR("Error prepending header to configuration file");
goto out_unlock; goto out_unlock;
} }
}
bret = load_config_locked(c, c->configfile); bret = load_config_locked(c, c->configfile);
out_unlock: out_unlock:
......
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