rpt->client_ip = strdupz(w->client_ip);
rpt->client_port = strdupz(w->client_port);
rpt->update_every = update_every;
-
- pthread_t *thread = mallocz(sizeof(pthread_t));
+ pthread_t thread;
debug(D_SYSTEM, "Starting STREAM thread for client [%s]:%s.", w->client_ip, w->client_port);
- if(pthread_create(thread, NULL, rrdpush_receiver_thread, (void *)rpt))
+ if(pthread_create(&thread, NULL, rrdpush_receiver_thread, (void *)rpt))
error("failed to create new STREAM thread for client [%s]:%s.", w->client_ip, w->client_port);
- else if(pthread_detach(*thread))
+ else if(pthread_detach(thread))
error("Cannot request detach newly created thread for client [%s]:%s.", w->client_ip, w->client_port);
// prevent the caller from closing the streaming socket