]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: avoid deref of explicitly NULL variable on error path
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 12 Dec 2013 18:57:21 +0000 (12:57 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 12 Dec 2013 18:57:21 +0000 (12:57 -0600)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 8bc3fe197866c264b440caa0a16a11d2b5c7b1f8..8206146418dfc9c27b12fa49cd89d9491049c6f0 100644 (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;
 }