Use free rather than delete for malloc'd memory
authorPerttu Ahola <celeron55@gmail.com>
Mon, 2 Jan 2012 19:42:33 +0000 (21:42 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 2 Jan 2012 19:42:33 +0000 (21:42 +0200)
src/client.cpp
src/server.cpp

index e3b250b32b88be33e1f12ca9bdbdf1581b2d056f..aca38b166e8c7655fb4d22b28ba0e906ce3541ab 100644 (file)
@@ -1343,7 +1343,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
                                                                <<name << ": server ->"<<sha1_texture <<" client -> "<<digest_string<<std::endl;
                                        }
 
-                                       delete(digest);
+                                       free(digest);
                                }
                        }
 
index b76d0e41aec17fd90e3eda2b81d1cdeecf675b40..8bf9eee3841eb71b98a53e92d756ab84c8961404 100644 (file)
@@ -4307,7 +4307,7 @@ void Server::PrepareTextures() {
                                unsigned char *digest = sha1.getDigest();
                                std::string digest_string = base64_encode(digest, 20);
 
-                               delete(digest);
+                               free(digest);
 
                                // Put in list
                                this->m_Textures[tname] = TextureInformation(tpath,digest_string);