From 50f30794031566df7fb8ea253007665a68c333fd Mon Sep 17 00:00:00 2001 From: Rick L Bird Date: Fri, 22 Apr 2011 18:22:42 -0400 Subject: [PATCH] Fixed bug in @name'ing players where game would crash. --- src/plyrlist.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plyrlist.c b/src/plyrlist.c index 082a2ac..ea289ce 100644 --- a/src/plyrlist.c +++ b/src/plyrlist.c @@ -85,7 +85,6 @@ add_player(dbref player) void add_player_alias(dbref player, const char *alias) { - long tmp; char tbuf1[BUFFER_LEN], *s, *sp; if (!hft_initialized) init_hft(); @@ -100,8 +99,12 @@ add_player_alias(dbref player, const char *alias) while (sp && *sp && *sp == ' ') sp++; if (sp && *sp) { - tmp = player; - hashadd(strupper(sp), (void *) tmp, &htab_player_list); + dbref *p; + p = slab_malloc(player_dbref_slab, NULL); + if (!p) + mush_panic(T("Unable to allocate memory in plyrlist!")); + *p = player; + hashadd(strupper(sp), p, &htab_player_list); } } } -- 2.30.2