From: Tycho Andersen Date: Tue, 13 Sep 2016 22:42:20 +0000 (-0600) Subject: c/r: free valid_opts if necessary X-Git-Tag: lxc-2.1.0~327^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1185%2Fhead;p=thirdparty%2Flxc.git c/r: free valid_opts if necessary 2cb80427bc468f7647309c3eca66cfc9afa85b61 introduced a malloc without a matching free. Signed-off-by: Tycho Andersen --- 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; }