]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: free valid_opts if necessary 1185/head
authorTycho Andersen <tycho.andersen@canonical.com>
Tue, 13 Sep 2016 22:42:20 +0000 (16:42 -0600)
committerTycho Andersen <tycho.andersen@canonical.com>
Tue, 13 Sep 2016 22:43:30 +0000 (16:43 -0600)
2cb80427bc468f7647309c3eca66cfc9afa85b61 introduced a malloc without a
matching free.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/lxccontainer.c

index c02e587e993ef5ab870937a359bde8c4a03f8efd..a1c94a1a467519f42603cee113b211c82d138022 100644 (file)
@@ -4007,6 +4007,9 @@ static int do_lxcapi_migrate(struct lxc_container *c, unsigned int cmd,
                ret = -EINVAL;
        }
 
+       if (size < sizeof(*opts))
+               free(valid_opts);
+
        return ret;
 }