diff options
author | Linus Nordberg <linus@nordu.net> | 2016-04-18 15:02:38 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-09-21 12:17:52 +0200 |
commit | 5acfcb4c7ce94482660dedb710e0b1f2ab8e5578 (patch) | |
tree | 92624c1abeb9274fc14e1174a6eb86cddce9f9b9 /radsecproxy.c | |
parent | 6c1f37d727afb31ac3fa4af4a4158993897d402d (diff) |
Stomp less on other threads memory.
See RADSECPROXY-64.
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); |