From fd2a29ab2668fea9c0ac972d5ec69f00232c88b6 Mon Sep 17 00:00:00 2001 From: Steffan Karger Date: Thu, 20 Jul 2017 13:39:00 +0200 Subject: Remove strerror_ts() This function was only called in string format functions, which already copy the contents, so all this ever did was adding redundant malloc() and free() calls. Also, this wasn't as thread-safe as it claims: another thread could still change the string value between the strerror() and buf_printf() calls. So, instead of a not needed false sense of thread-safeness, just be honest and use strerror() directly. (I think we should find a better place for everything currently in misc.c, and get rid of it all together. In this case, the better place is /dev/null. This patch is part of that effort.) Signed-off-by: Steffan Karger Acked-by: Gert Doering Message-Id: <1500550740-24773-1-git-send-email-steffan.karger@fox-it.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15105.html Signed-off-by: Gert Doering --- src/openvpn/socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/openvpn/socket.c') diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index a814b95..846df04 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1473,10 +1473,8 @@ socket_connect(socket_descriptor_t *sd, if (status) { - msg(D_LINK_ERRORS, - "TCP: connect to %s failed: %s", - print_sockaddr(dest, &gc), - strerror_ts(status, &gc)); + msg(D_LINK_ERRORS, "TCP: connect to %s failed: %s", + print_sockaddr(dest, &gc), strerror(status)); openvpn_close_socket(*sd); *sd = SOCKET_UNDEFINED; -- cgit v1.1