From: Serge Hallyn Date: Tue, 20 Aug 2013 21:58:24 +0000 (-0500) Subject: coverity: correctly handle tpath error case. X-Git-Tag: lxc-1.0.0.alpha1~1^2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01efd4d3d91713fc4f8ca55c7726b8216ed16fc6;p=thirdparty%2Flxc.git coverity: correctly handle tpath error case. Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index c68dc6e4b..f3efb0084 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -910,7 +910,8 @@ bool prepend_lxc_header(char *path, const char *t, char *const argv[]) } #if HAVE_LIBGNUTLS - if ((tpath = get_template_path(t)) < 0) { + tpath = get_template_path(t); + if (tpath == (char *) -1) { ERROR("bad template: %s\n", t); free(contents); return false; @@ -991,7 +992,8 @@ static bool lxcapi_create(struct lxc_container *c, const char *t, if (!c) return false; - if ((tpath = get_template_path(t)) < 0) { + tpath = get_template_path(t); + if (tpath == (char *) -1) { ERROR("bad template: %s\n", t); goto out; }