summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_ipcp_enroll.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-25 10:45:14 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-25 10:45:14 +0200
commitca87c116be0676b20a1c1ad69635d1aa652887ac (patch)
tree6b15a66b18a721ae9b9b9f1791bd5bd9dfda0e74 /src/tools/irm/irm_ipcp_enroll.c
parent8f9aa6f02772d6f46b55741cdd76607a4e22c6a1 (diff)
downloadouroboros-ca87c116be0676b20a1c1ad69635d1aa652887ac.tar.gz
ouroboros-ca87c116be0676b20a1c1ad69635d1aa652887ac.zip
tools: Fix memleak in irm_ipcp_enroll
Diffstat (limited to 'src/tools/irm/irm_ipcp_enroll.c')
-rw-r--r--src/tools/irm/irm_ipcp_enroll.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/irm/irm_ipcp_enroll.c b/src/tools/irm/irm_ipcp_enroll.c
index 3755f199..32d8be54 100644
--- a/src/tools/irm/irm_ipcp_enroll.c
+++ b/src/tools/irm/irm_ipcp_enroll.c
@@ -70,9 +70,12 @@ int do_enroll_ipcp(int argc, char ** argv)
len = irm_list_ipcps(name, &apis);
}
- for (i = 0; i < len; i++)
- if (irm_enroll_ipcp(apis[i], dif_name))
+ for (i = 0; i < len; i++) {
+ if (irm_enroll_ipcp(apis[i], dif_name)) {
+ free(apis);
return -1;
+ }
+ }
if (apis != NULL)
free(apis);