mextra follow up bit 2
<Someone> noticed the leftover zeromextra, this removes it. Using memset() on a possibly failed mextra allocation was inapprorpriate, so replace the newmextra() macro with a function. Prevent a crash in christen_monst() if mextra was not initialized.
This commit is contained in:
@@ -233,6 +233,7 @@ const char *name;
|
||||
return mtmp;
|
||||
}
|
||||
if (has_name(mtmp)) free((genericptr_t)MNAME(mtmp));
|
||||
if (!mtmp->mextra) mtmp->mextra = newmextra();
|
||||
|
||||
MNAME(mtmp) = (char *)alloc(lth);
|
||||
if (lth) Strcpy(MNAME(mtmp), name);
|
||||
|
||||
Reference in New Issue
Block a user