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: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc_conf_free(c->lxc_conf);
c->lxc_conf = NULL;
- if (!prepend_lxc_header(c->configfile, tpath, argv)) {
- ERROR("Error prepending header to configuration file");
- goto out_unlock;
+ if (t) {
+ if (!prepend_lxc_header(c->configfile, tpath, argv)) {
+ ERROR("Error prepending header to configuration file");
+ goto out_unlock;
+ }
}
bret = load_config_locked(c, c->configfile);