]> 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>
Fri, 15 Dec 2017 12:23:35 +0000 (13:23 +0100)
free allocated memory

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

index 4b43240d5a401fcfa9549895420c9ea3334fe13d..2a1beca7f625bbcde2776e6e9ecfc7d61da3b1bd 100644 (file)
@@ -821,10 +821,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