fix possible NULL deref bug
This commit is contained in:
parent
7c31cf3a7d
commit
92caa7fd70
1 changed files with 5 additions and 4 deletions
9
spawn.c
9
spawn.c
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue