mirror of
git://github.com/lxc/lxc
synced 2025-08-31 02:29:34 +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 ((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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user