Skip to content

Commit

Permalink
tools/utils: free memory on error
Browse files Browse the repository at this point in the history
Closes #2262.

Signed-off-by: C0deAi <techsupport@mycode.ai>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
C0deAi authored and Christian Brauner committed Apr 20, 2018
1 parent 21dae50 commit 7292d59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lxc/tools/tool_utils.c
Expand Up @@ -794,8 +794,11 @@ int lxc_config_define_add(struct lxc_list *defines, char *arg)
return -1;

dent->elem = parse_line(arg);
if (!dent->elem)
if (!dent->elem) {
free(dent);
return -1;
}

lxc_list_add_tail(defines, dent);
return 0;
}
Expand Down

0 comments on commit 7292d59

Please sign in to comment.