https://bugs.winehq.org/show_bug.cgi?id=28756
--- Comment #5 from Austin English austinenglish@gmail.com --- (In reply to Bruno Jesus from comment #4)
Created attachment 48730 [details] patch
I think the function is doing cleanup before the thread is able to test the socket, this patch may help. Please, test it.
Yup, works here, thanks.
I noticed that my patch for https://bugs.kde.org/show_bug.cgi?id=335441 avoids the valgrind issue without using your patch.