]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
fix possible NULL deref bug
authorAndreas Öman <andreas@lonelycoder.com>
Thu, 21 Feb 2008 21:45:15 +0000 (21:45 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Thu, 21 Feb 2008 21:45:15 +0000 (21:45 +0000)
spawn.c

diff --git a/spawn.c b/spawn.c
index c692c563d22271da83098ee0b95ba7208664c4bf..139a1e50910494aecd2e7c41d56823a5435f71ca 100644 (file)
--- 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 : "<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);
   }
 }