summaryrefslogtreecommitdiff
path: root/tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tls.c')
-rw-r--r--tls.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tls.c b/tls.c
index d33fc1b..0564c7e 100644
--- a/tls.c
+++ b/tls.c
@@ -397,7 +397,7 @@ void *tlsservernew(void *arg) {
struct client *client;
struct tls *accepted_tls = NULL;
- s = *(int *)arg;
+ s = (int) arg;
if (getpeername(s, (struct sockaddr *)&from, &fromlen)) {
debug(DBG_DBG, "tlsservernew: getpeername failed, exiting");
goto exit;
@@ -458,19 +458,19 @@ exit:
void *tlslistener(void *arg) {
pthread_t tlsserverth;
- int s, *sp = (int *)arg;
+ int s, listensock = (int) arg;
struct sockaddr_storage from;
socklen_t fromlen = sizeof(from);
- listen(*sp, 0);
+ listen(listensock, 0);
for (;;) {
- s = accept(*sp, (struct sockaddr *)&from, &fromlen);
+ s = accept(listensock, (struct sockaddr *)&from, &fromlen);
if (s < 0) {
debug(DBG_WARN, "accept failed");
continue;
}
- if (pthread_create(&tlsserverth, &pthread_attr, tlsservernew, (void *)&s)) {
+ if (pthread_create(&tlsserverth, &pthread_attr, tlsservernew, (void *) s)) {
debug(DBG_ERR, "tlslistener: pthread_create failed");
shutdown(s, SHUT_RDWR);
close(s);
@@ -478,7 +478,6 @@ void *tlslistener(void *arg) {
}
pthread_detach(tlsserverth);
}
- free(sp);
return NULL;
}
#else