From 3ae16f1c17c2b23c143b5a4ee6191f37d5371633 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sun, 8 Mar 2015 18:13:27 +0100 Subject: [PATCH] Fix memleak pointed by issue #2439. Also change bzero to memset. bzero doesn't work on windows --- src/client.cpp | 4 ++-- 1 file 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());