From: Nick Burrett Date: Wed, 29 Apr 2015 06:59:28 +0000 (+0100) Subject: Fix crash when trying to configure adapters that are already in use. X-Git-Tag: v4.1~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bcf09f2ab0cb33d4faee6a0d9e738850c63519c;p=thirdparty%2Ftvheadend.git Fix crash when trying to configure adapters that are already in use. If another application has an adapter open, then la==NULL. Skip the adapter so that another can be configured. --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_adapter.c b/src/input/mpegts/linuxdvb/linuxdvb_adapter.c index 99602d206..843809395 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_adapter.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_adapter.c @@ -399,6 +399,10 @@ linuxdvb_adapter_add ( const char *path ) /* Relock before exit */ pthread_mutex_lock(&global_lock); + /* Adapter couldn't be opened; there's nothing to work with */ + if (!la) + return; + #if DVB_VER_ATLEAST(5,5) memset(fetypes, 0, sizeof(fetypes)); LIST_FOREACH(lfe, &la->la_frontends, lfe_link)