Skip to content

Commit 2ed3067

Browse files
committedAug 7, 2013
Fix various memory access problems detected by valgrind
1 parent 218f82f commit 2ed3067

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed
 

‎src/content_sao.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,11 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
943943
m_properties_sent(true),
944944
m_privs(privs),
945945
m_is_singleplayer(is_singleplayer),
946+
m_animation_speed(0),
947+
m_animation_blend(0),
946948
m_animation_sent(false),
947949
m_bone_position_sent(false),
950+
m_attachment_parent_id(0),
948951
m_attachment_sent(false),
949952
// public
950953
m_moved(false),

‎src/filesys.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ bool PathStartsWith(std::string path, std::string prefix)
595595
&& !IsDirDelimiter(path[pathpos+len])
596596
&& prefixpos+len < prefixsize
597597
&& !IsDirDelimiter(
598-
prefix[prefixsize+len]));
598+
prefix[prefixpos+len]));
599599
pathpos += len;
600600
prefixpos += len;
601601
}

‎src/guiFormSpecMenu.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
174174
current_keys_pending.key_down = false;
175175
current_keys_pending.key_up = false;
176176
current_keys_pending.key_enter = false;
177+
current_keys_pending.key_escape = false;
177178

178179
}
179180

‎src/player.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ Player::Player(IGameDef *gamedef):
3434
is_climbing(false),
3535
swimming_vertical(false),
3636
camera_barely_in_ceiling(false),
37+
light(0),
3738
inventory(gamedef->idef()),
3839
hp(PLAYER_MAX_HP),
40+
hurt_tilt_timer(0),
41+
hurt_tilt_strength(0),
3942
peer_id(PEER_ID_INEXISTENT),
43+
keyPressed(0),
4044
// protected
4145
m_gamedef(gamedef),
4246
m_breath(-1),

0 commit comments

Comments
 (0)
Please sign in to comment.