]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: correctly handle tpath error case.
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 20 Aug 2013 21:58:24 +0000 (16:58 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 20 Aug 2013 21:58:24 +0000 (16:58 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index c68dc6e4b28f4ce5aa0ce792cbaf6a3e3da88816..f3efb00840251a3d1056219a9c5c6f2e913748d7 100644 (file)
@@ -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;
        }