From: Christian Brauner Date: Fri, 15 Jun 2018 09:54:14 +0000 (+0200) Subject: coverity: #1425819 X-Git-Tag: lxc-3.1.0~245^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1cfe3e20af65eaa9948e504703cd0a9ed263136;p=thirdparty%2Flxc.git coverity: #1425819 Resource leak Signed-off-by: Christian Brauner --- diff --git a/src/lxc/tools/lxc_ls.c b/src/lxc/tools/lxc_ls.c index 4604d1ac9..a192eb0d5 100644 --- a/src/lxc/tools/lxc_ls.c +++ b/src/lxc/tools/lxc_ls.c @@ -819,6 +819,7 @@ static void ls_print_fancy_format(struct ls *l, struct lengths *lht, strcasecmp(*s, "GROUPS") && strcasecmp(*s, "INTERFACE") && strcasecmp(*s, "IPV4") && strcasecmp(*s, "IPV6") && strcasecmp(*s, "UNPRIVILEGED")) { + lxc_free_array((void **)tmp, free); fprintf(stderr, "Invalid key: %s\n", *s); return; } @@ -895,6 +896,8 @@ static void ls_print_fancy_format(struct ls *l, struct lengths *lht, } printf("\n"); } + + lxc_free_array((void **)tmp, free); } static void ls_print_table(struct ls *l, struct lengths *lht,