forked from github/server
fixing strdup(NULL) call
This commit is contained in:
parent
93091caff0
commit
256d0b1d4b
1 changed files with 5 additions and 1 deletions
|
@ -1650,7 +1650,11 @@ sp_undeadhero(fighter * fi, int level, double power, spell * sp)
|
|||
|
||||
/* new units gets some stats from old unit */
|
||||
free(u->display);
|
||||
u->display = strdup(du->display);
|
||||
if (du->display) {
|
||||
u->display = strdup(du->display);
|
||||
} else {
|
||||
u->display = NULL;
|
||||
}
|
||||
setstatus(u, du->status);
|
||||
setguard(u, GUARD_NONE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue