From 908fde6aad6ed8063fc1a88cf962ca655b9a3441 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Thu, 12 Dec 2013 12:57:21 -0600 Subject: [PATCH] coverity: avoid deref of explicitly NULL variable on error path Signed-off-by: Serge Hallyn --- src/lxc/conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }