aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-08 18:13:27 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-08 18:13:27 +0100
commit3ae16f1c17c2b23c143b5a4ee6191f37d5371633 (patch)
tree3cf9e770b0989f4cda77722acf5e875cd7a7fc79 /src
parent57d86cf57411225433c651cf50fe9e130cf407e3 (diff)
downloadminetest-3ae16f1c17c2b23c143b5a4ee6191f37d5371633.tar.gz
minetest-3ae16f1c17c2b23c143b5a4ee6191f37d5371633.tar.bz2
minetest-3ae16f1c17c2b23c143b5a4ee6191f37d5371633.zip
Fix memleak pointed by issue #2439.
Also change bzero to memset. bzero doesn't work on windows
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp4
1 files changed, 2 insertions, 2 deletions
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());