]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1425929
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 7 Dec 2017 13:59:55 +0000 (14:59 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 17 Dec 2017 15:25:57 +0000 (16:25 +0100)
free allocated memory

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 8fb158ab2f3701a9f7f23a5168bf312eb55c5d56..dce04285109ef2f7487d3e833dcdf7f66f719ca9 100644 (file)
@@ -816,10 +816,12 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
 
        /* ... otherwise use default_args. */
        if (!argv) {
-               if (useinit)
+               if (useinit) {
+                       ERROR("No valid init detected");
+                       lxc_free_handler(handler);
                        return false;
-               else
-                       argv = default_args;
+               }
+               argv = default_args;
        }
 
        /* I'm not sure what locks we want here.Any? Is liblxc's locking enough