diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 8bc3fe197..820614641 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -4008,7 +4008,8 @@ static struct lxc_list *idmap_add_id(struct lxc_conf *conf, uid_t uid) err: ERROR("Out of memory building a new uid map"); - lxc_free_idmap(new); + if (new) + lxc_free_idmap(new); free(new); return NULL; }