fix possible NULL deref bug

This commit is contained in:
Andreas Öman 2008-02-21 21:45:15 +00:00
parent 7c31cf3a7d
commit 92caa7fd70

View file

@ -80,10 +80,11 @@ reaper(void *opaque, int64_t now)
}
syslog(LOG_INFO, "spawn: \"%s\" %s", s ? s->name : "<unknwon spawn>", txt);
LIST_REMOVE(s, link);
free((void *)s->name);
free(s);
if(s != NULL) {
LIST_REMOVE(s, link);
free((void *)s->name);
free(s);
}
pthread_mutex_unlock(&spawn_mutex);
}
}