2
0
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:
Serge Hallyn
2013-08-20 16:58:24 -05:00
parent 1fd9bd50ab
commit 01efd4d3d9

View 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;
}