summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_ipcp_enroll.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-08-22 16:41:35 +0200
committerdimitri staessens <[email protected]>2016-08-22 16:41:35 +0200
commit34123b6bfc39e5bea5f2c599b1eea51d3c82ba06 (patch)
treec97511258dca33022059718fc1ea666808222e42 /src/tools/irm/irm_ipcp_enroll.c
parent82c6b3ed73b01321141488c634c9c1c4d515b04b (diff)
downloadouroboros-34123b6bfc39e5bea5f2c599b1eea51d3c82ba06.tar.gz
ouroboros-34123b6bfc39e5bea5f2c599b1eea51d3c82ba06.zip
tools: Fix segmentation faults
The apis parameter is not set if the IRMd is not running when running the tool.
Diffstat (limited to 'src/tools/irm/irm_ipcp_enroll.c')
-rw-r--r--src/tools/irm/irm_ipcp_enroll.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/irm/irm_ipcp_enroll.c b/src/tools/irm/irm_ipcp_enroll.c
index b7a12e2c..3755f199 100644
--- a/src/tools/irm/irm_ipcp_enroll.c
+++ b/src/tools/irm/irm_ipcp_enroll.c
@@ -39,7 +39,7 @@ int do_enroll_ipcp(int argc, char ** argv)
{
char * name = NULL;
char * dif_name = NULL;
- pid_t * apis;
+ pid_t * apis = NULL;
ssize_t len = 0;
int i = 0;
@@ -74,7 +74,8 @@ int do_enroll_ipcp(int argc, char ** argv)
if (irm_enroll_ipcp(apis[i], dif_name))
return -1;
- free(apis);
+ if (apis != NULL)
+ free(apis);
return 0;
}