coverity: avoid deref of explicitly NULL variable on error path

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2013-12-12 12:57:21 -06:00
parent 32571606a1
commit 908fde6aad

View File

@ -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;
}