From: Christian Brauner Date: Thu, 8 Feb 2018 14:57:02 +0000 (+0100) Subject: lxccontainer: satisfy coverity X-Git-Tag: lxc-3.0.0.beta1~39^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb8ff4d033397ff16fd4e75f99d40c1371370010;p=thirdparty%2Flxc.git lxccontainer: satisfy coverity The container name can't be NULL so don't give coverity the impression that it could be. Silences coverity #1426123. Silences coverity #1426124. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 465d27fb8..f0191c177 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2727,7 +2727,7 @@ static bool container_destroy(struct lxc_container *c, if (conf && !lxc_list_empty(&conf->hooks[LXCHOOK_DESTROY])) { /* Start of environment variable setup for hooks */ - if (c->name && setenv("LXC_NAME", c->name, 1)) + if (setenv("LXC_NAME", c->name, 1)) SYSERROR("Failed to set environment variable for container name"); if (conf->rcfile && setenv("LXC_CONFIG_FILE", conf->rcfile, 1)) @@ -3425,7 +3425,7 @@ static int clone_update_rootfs(struct clone_update_data *data) if (c0->name && setenv("LXC_SRC_NAME", c0->name, 1)) { SYSERROR("failed to set environment variable for source container name"); } - if (c->name && setenv("LXC_NAME", c->name, 1)) { + if (setenv("LXC_NAME", c->name, 1)) { SYSERROR("failed to set environment variable for container name"); } if (conf->rcfile && setenv("LXC_CONFIG_FILE", conf->rcfile, 1)) {