diff options
author | dimitri staessens <[email protected]> | 2016-08-25 10:45:14 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-08-25 10:45:14 +0200 |
commit | ca87c116be0676b20a1c1ad69635d1aa652887ac (patch) | |
tree | 6b15a66b18a721ae9b9b9f1791bd5bd9dfda0e74 /src/tools/irm/irm_ipcp_enroll.c | |
parent | 8f9aa6f02772d6f46b55741cdd76607a4e22c6a1 (diff) | |
download | ouroboros-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.c | 7 |
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); |