From 635386faad0f9ed6ce3ea2b83484e6ce3ffba937 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 15 Nov 2012 14:02:17 +0000 Subject: More valgrind fixes git-svn-id: http://mc-server.googlecode.com/svn/trunk@1044 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/BioGen.cpp | 4 ++-- source/Generating/HeiGen.cpp | 4 ++-- source/OSSupport/Socket.cpp | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/Generating/BioGen.cpp b/source/Generating/BioGen.cpp index a43d995df..d12bdcf52 100644 --- a/source/Generating/BioGen.cpp +++ b/source/Generating/BioGen.cpp @@ -51,8 +51,8 @@ cBioGenCache::cBioGenCache(cBiomeGen * a_BioGenToCache, int a_CacheSize) : cBioGenCache::~cBioGenCache() { - delete m_CacheData; - delete m_CacheOrder; + delete[] m_CacheData; + delete[] m_CacheOrder; delete m_BioGenToCache; } diff --git a/source/Generating/HeiGen.cpp b/source/Generating/HeiGen.cpp index ed353751c..0fe0ea74f 100644 --- a/source/Generating/HeiGen.cpp +++ b/source/Generating/HeiGen.cpp @@ -51,8 +51,8 @@ cHeiGenCache::cHeiGenCache(cTerrainHeightGen * a_HeiGenToCache, int a_CacheSize) cHeiGenCache::~cHeiGenCache() { - delete m_CacheData; - delete m_CacheOrder; + delete[] m_CacheData; + delete[] m_CacheOrder; delete m_HeiGenToCache; } diff --git a/source/OSSupport/Socket.cpp b/source/OSSupport/Socket.cpp index 8d6a5ee94..d44a343e0 100644 --- a/source/OSSupport/Socket.cpp +++ b/source/OSSupport/Socket.cpp @@ -239,10 +239,9 @@ cSocket cSocket::Accept() cSocket SClient = accept(m_Socket, (sockaddr*)&from, &fromlen); - if (from.sin_addr.s_addr && SClient.IsValid()) // Get IP in string form + if (SClient.IsValid() && (from.sin_addr.s_addr != 0)) // Get IP in string form { SClient.m_IPString = inet_ntoa(from.sin_addr); - //LOG("cSocket::Accept() %s", SClient.m_IPString); } return SClient; -- cgit v1.2.3