Fix ASAN crashes and LSAN leaks (#7649)

This commit is contained in:
Vincent Stumpf
2023-03-20 09:32:41 -07:00
committed by GitHub
parent 4d9b1a0b83
commit 819b7cb361
8 changed files with 15 additions and 6 deletions

View File

@@ -1022,7 +1022,9 @@ bool pet_data_init(map_session_data *sd, struct s_pet *pet)
return false;
}
sd->pd = pd = (struct pet_data *)aCalloc(1,sizeof(struct pet_data));
pd = (struct pet_data *)aCalloc(1,sizeof(struct pet_data));
new(pd) pet_data();
sd->pd = pd;
pd->bl.type = BL_PET;
pd->bl.id = npc_get_new_npc_id();