null-pointer check befor strcmp.

This commit is contained in:
Enno Rehling 2019-08-10 05:10:00 +02:00
parent 12117776a0
commit 061cadfce8
1 changed files with 2 additions and 2 deletions

View File

@ -565,8 +565,8 @@ int autoseed(newfaction ** players, int nsize, int max_agediff)
nfp = &nextf->next;
while (*nfp) {
newfaction *nf = *nfp;
if (strcmp(nextf->email, nf->email) == 0) {
log_warning("Duplicate email %s\n", nf->email?nf->email:"");
if (nf->email && nextf->email && strcmp(nextf->email, nf->email) == 0) {
log_warning("Duplicate email %s\n", nf->email ? nf->email : "");
*nfp = nf->next;
free_newfaction(nf);
}