diff options
Diffstat (limited to 'radsecproxy.c')
-rw-r--r-- | radsecproxy.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 1590e65..d4b6578 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1990,7 +1990,7 @@ errexit: void createlistener(uint8_t type, char *arg) { pthread_t th; struct addrinfo *res; - int s = -1, on = 1, *sp = NULL; + int s = -1, on = 1; struct hostportres *hp = newhostport(arg, protodefs[type]->portdefault, 0); if (!hp || !resolvehostport(hp, AF_UNSPEC, protodefs[type]->socktype, 1)) @@ -2017,16 +2017,10 @@ void createlistener(uint8_t type, char *arg) { continue; } - sp = malloc(sizeof(int)); - if (!sp) - debugx(1, DBG_ERR, "malloc failed"); - *sp = s; - if (pthread_create(&th, &pthread_attr, protodefs[type]->listener, (void *)sp)) + if (pthread_create(&th, &pthread_attr, protodefs[type]->listener, (void *)s)) debugerrnox(errno, DBG_ERR, "pthread_create failed"); pthread_detach(th); } - if (!sp) - debugx(1, DBG_ERR, "createlistener: socket/bind failed"); debug(DBG_WARN, "createlistener: listening for %s on %s:%s", protodefs[type]->name, hp->host ? hp->host : "*", hp->port); freehostport(hp); |