From: Loic Blot Date: Sun, 8 Mar 2015 17:13:27 +0000 (+0100) Subject: Fix memleak pointed by issue #2439. X-Git-Tag: 0.4.13~508 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3ae16f1c17c2b23c143b5a4ee6191f37d5371633;p=oweals%2Fminetest.git Fix memleak pointed by issue #2439. Also change bzero to memset. bzero doesn't work on windows --- diff --git a/src/client.cpp b/src/client.cpp index ba6835f51..e36c04edc 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -401,8 +401,8 @@ void Client::step(float dtime) char pName[PLAYERNAME_SIZE]; char pPassword[PASSWORD_SIZE]; - bzero(pName, PLAYERNAME_SIZE); - bzero(pPassword, PLAYERNAME_SIZE); + memset(pName, 0, PLAYERNAME_SIZE * sizeof(char)); + memset(pPassword, 0, PASSWORD_SIZE * sizeof(char)); snprintf(pName, PLAYERNAME_SIZE, "%s", myplayer->getName()); snprintf(pPassword, PASSWORD_SIZE, "%s", m_password.c_str());