diff options
Diffstat (limited to 'src/stats.c')
-rw-r--r-- | src/stats.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/stats.c b/src/stats.c index 7237c61..584d68a 100644 --- a/src/stats.c +++ b/src/stats.c @@ -459,9 +459,8 @@ update_players(char *buf, size_t siz, Player *new_player) player = find_player(new_player->userid); s += write_quote(buf + s, siz - s); if (player == NULL) { /* new player */ - player = memdup(new_player, sizeof(*new_player)); - if (player == NULL) - die(1, "memdup:"); + player = xmalloc(sizeof(*player)); + memcpy(player, new_player, sizeof(*player)); player->next = player_head; player_head = player; s += snprintf(buf + s, siz - s, |