From: Andreas Ă–man Date: Thu, 21 Feb 2008 21:45:15 +0000 (+0000) Subject: fix possible NULL deref bug X-Git-Tag: 2.12~1184 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92caa7fd70b4e1b50bc14be65dfa37336acd37f5;p=thirdparty%2Ftvheadend.git fix possible NULL deref bug --- diff --git a/spawn.c b/spawn.c index c692c563d..139a1e509 100644 --- a/spawn.c +++ b/spawn.c @@ -80,10 +80,11 @@ reaper(void *opaque, int64_t now) } syslog(LOG_INFO, "spawn: \"%s\" %s", s ? s->name : "", 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); } }