Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix various memory access problems detected by valgrind
  • Loading branch information
kahrl committed Aug 7, 2013
1 parent 218f82f commit 2ed3067
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/content_sao.cpp
Expand Up @@ -943,8 +943,11 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
m_properties_sent(true),
m_privs(privs),
m_is_singleplayer(is_singleplayer),
m_animation_speed(0),
m_animation_blend(0),
m_animation_sent(false),
m_bone_position_sent(false),
m_attachment_parent_id(0),
m_attachment_sent(false),
// public
m_moved(false),
Expand Down
2 changes: 1 addition & 1 deletion src/filesys.cpp
Expand Up @@ -595,7 +595,7 @@ bool PathStartsWith(std::string path, std::string prefix)
&& !IsDirDelimiter(path[pathpos+len])
&& prefixpos+len < prefixsize
&& !IsDirDelimiter(
prefix[prefixsize+len]));
prefix[prefixpos+len]));
pathpos += len;
prefixpos += len;
}
Expand Down
1 change: 1 addition & 0 deletions src/guiFormSpecMenu.cpp
Expand Up @@ -174,6 +174,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
current_keys_pending.key_down = false;
current_keys_pending.key_up = false;
current_keys_pending.key_enter = false;
current_keys_pending.key_escape = false;

}

Expand Down
4 changes: 4 additions & 0 deletions src/player.cpp
Expand Up @@ -34,9 +34,13 @@ Player::Player(IGameDef *gamedef):
is_climbing(false),
swimming_vertical(false),
camera_barely_in_ceiling(false),
light(0),
inventory(gamedef->idef()),
hp(PLAYER_MAX_HP),
hurt_tilt_timer(0),
hurt_tilt_strength(0),
peer_id(PEER_ID_INEXISTENT),
keyPressed(0),
// protected
m_gamedef(gamedef),
m_breath(-1),
Expand Down

0 comments on commit 2ed3067

Please sign in to comment.