From 4c0c322387ec065a9d6363cb12a145b7ae4da0ac Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 5 Feb 2011 09:39:15 +0000 Subject: [PATCH] use free/malloc instead of realloc in udp_socket --- src/udp_socket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/udp_socket.cpp b/src/udp_socket.cpp index d32261682..d1e73b098 100644 --- a/src/udp_socket.cpp +++ b/src/udp_socket.cpp @@ -198,13 +198,15 @@ void udp_socket::maybe_realloc_buffers(int which) TORRENT_ASSERT(is_single_thread()); if (m_reallocate_buffer4 && (which & 1)) { - m_v4_buf = (char*)realloc(m_v4_buf, m_v4_buf_size); + free(m_v4_buf); + m_v4_buf = (char*)malloc(m_v4_buf_size); m_reallocate_buffer4 = false; } #if TORRENT_USE_IPV6 if (m_reallocate_buffer6 && (which & 2)) { - m_v6_buf = (char*)realloc(m_v6_buf, m_v6_buf_size); + free(m_v6_buf); + m_v6_buf = (char*)malloc(m_v6_buf_size); m_reallocate_buffer6 = false; } #endif