coverity: #1425819

Resource leak Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent cd1cbee0
...@@ -803,10 +803,11 @@ static void ls_print_fancy_format(struct ls *l, struct lengths *lht, ...@@ -803,10 +803,11 @@ static void ls_print_fancy_format(struct ls *l, struct lengths *lht,
/* Check for invalid keys. */ /* Check for invalid keys. */
for (s = tmp; s && *s; s++) { for (s = tmp; s && *s; s++) {
if (strcasecmp(*s, "NAME") && strcasecmp(*s, "STATE") && if (strcasecmp(*s, "NAME") && strcasecmp(*s, "STATE") &&
strcasecmp(*s, "PID") && strcasecmp(*s, "RAM") && strcasecmp(*s, "PID") && strcasecmp(*s, "RAM") &&
strcasecmp(*s, "SWAP") && strcasecmp(*s, "AUTOSTART") && strcasecmp(*s, "SWAP") && strcasecmp(*s, "AUTOSTART") &&
strcasecmp(*s, "GROUPS") && strcasecmp(*s, "INTERFACE") && strcasecmp(*s, "GROUPS") && strcasecmp(*s, "INTERFACE") &&
strcasecmp(*s, "IPV4") && strcasecmp(*s, "IPV6")) { strcasecmp(*s, "IPV4") && strcasecmp(*s, "IPV6")) {
lxc_free_array((void **)tmp, free);
fprintf(stderr, "Invalid key: %s\n", *s); fprintf(stderr, "Invalid key: %s\n", *s);
return; return;
} }
...@@ -879,6 +880,8 @@ static void ls_print_fancy_format(struct ls *l, struct lengths *lht, ...@@ -879,6 +880,8 @@ static void ls_print_fancy_format(struct ls *l, struct lengths *lht,
} }
printf("\n"); printf("\n");
} }
lxc_free_array((void **)tmp, free);
} }
static void ls_print_table(struct ls *l, struct lengths *lht, static void ls_print_table(struct ls *l, struct lengths *lht,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment