From f686506dfb2a7fe61b4ff1b3192bef6db19be2ac Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Tue, 13 Sep 2016 16:42:20 -0600 Subject: [PATCH] c/r: free valid_opts if necessary 2cb80427bc468f7647309c3eca66cfc9afa85b61 introduced a malloc without a matching free. Signed-off-by: Tycho Andersen --- src/lxc/lxccontainer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index c02e587e9..a1c94a1a4 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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; } -- 2.47.2