Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
coverity fixes: some wrong NULL checks
  • Loading branch information
perexg committed Oct 3, 2014
1 parent d94850a commit 1932c7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/dvr/dvr_autorec.c
Expand Up @@ -410,7 +410,7 @@ dvr_autorec_entry_class_title_set(void *o, const void *v)
free(dae->dae_title);
dae->dae_title = NULL;
}
if (title != NULL && title[0] != '\0' &&
if (title[0] != '\0' &&
!regcomp(&dae->dae_title_preg, title,
REG_ICASE | REG_EXTENDED | REG_NOSUB))
dae->dae_title = strdup(title);
Expand Down
3 changes: 2 additions & 1 deletion src/dvr/dvr_rec.c
Expand Up @@ -178,11 +178,12 @@ pvr_generate_filename(dvr_entry_t *de, const streaming_start_t *ss)
struct stat st;
char *filename, *s;
struct tm tm;
dvr_config_t *cfg = de->de_config;
dvr_config_t *cfg;

if (de == NULL)
return -1;

cfg = de->de_config;
strncpy(path, cfg->dvr_storage, sizeof(path));
path[sizeof(path)-1] = '\0';

Expand Down
8 changes: 5 additions & 3 deletions src/input/mpegts/linuxdvb/linuxdvb_frontend.c
Expand Up @@ -118,9 +118,11 @@ static int
linuxdvb_frontend_dvbs_class_satconf_set ( void *self, const void *str )
{
linuxdvb_frontend_t *lfe = self;
if (lfe->lfe_satconf && !strcmp(str ?: "", lfe->lfe_satconf->ls_type))
return 0;
linuxdvb_satconf_delete(lfe->lfe_satconf, 1);
if (lfe->lfe_satconf) {
if (!strcmp(str ?: "", lfe->lfe_satconf->ls_type))
return 0;
linuxdvb_satconf_delete(lfe->lfe_satconf, 1);
}
lfe->lfe_satconf = linuxdvb_satconf_create(lfe, str, NULL, NULL);
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/muxer/tvh/mkmux.c
Expand Up @@ -659,8 +659,8 @@ _mk_build_metadata(const dvr_entry_t *de, const epg_broadcast_t *ebc)
channel_t *ch;
lang_str_t *ls = NULL;

if (ebc) ee = ebc->episode;
else if (de->de_bcast) ee = de->de_bcast->episode;
if (ebc) ee = ebc->episode;
else if (de && de->de_bcast) ee = de->de_bcast->episode;

if (de) ch = de->de_channel;
else ch = ebc->channel;
Expand Down

0 comments on commit 1932c7e

Please sign in to comment.