From: Rick L Bird Date: Fri, 22 Apr 2011 22:22:42 +0000 (-0400) Subject: Fixed bug in @name'ing players where game would crash. X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=50f30794031566df7fb8ea253007665a68c333fd;p=cobramush.git Fixed bug in @name'ing players where game would crash. --- 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); } } }