mirror of
git://github.com/lxc/lxc
synced 2025-09-01 17:39:28 +00:00
coverity: correctly handle tpath error case.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
@@ -910,7 +910,8 @@ bool prepend_lxc_header(char *path, const char *t, char *const argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_LIBGNUTLS
|
#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);
|
ERROR("bad template: %s\n", t);
|
||||||
free(contents);
|
free(contents);
|
||||||
return false;
|
return false;
|
||||||
@@ -991,7 +992,8 @@ static bool lxcapi_create(struct lxc_container *c, const char *t,
|
|||||||
if (!c)
|
if (!c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((tpath = get_template_path(t)) < 0) {
|
tpath = get_template_path(t);
|
||||||
|
if (tpath == (char *) -1) {
|
||||||
ERROR("bad template: %s\n", t);
|
ERROR("bad template: %s\n", t);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user