- Fix - In case that num parameter was NULL, epg_episode_num_deserialize funcion would return newly calloc'd
epg_episode_num_t, but it's never used like this, so better remove the calloc, and make it void return.
(cherry picked from commit 4f3cf8e695
)
This commit is contained in:
parent
097c0816e1
commit
4c61110d68
1 changed files with 5 additions and 7 deletions
12
src/epg.c
12
src/epg.c
|
@ -767,16 +767,15 @@ static htsmsg_t *epg_episode_num_serialize ( epg_episode_num_t *num )
|
|||
return m;
|
||||
}
|
||||
|
||||
static epg_episode_num_t *epg_episode_num_deserialize
|
||||
static void epg_episode_num_deserialize
|
||||
( htsmsg_t *m, epg_episode_num_t *num )
|
||||
{
|
||||
const char *str;
|
||||
uint32_t u32;
|
||||
if (!m) return NULL;
|
||||
if (!num)
|
||||
num = calloc(1, sizeof(epg_episode_num_t));
|
||||
else
|
||||
memset(num, 0, sizeof(epg_episode_num_t));
|
||||
assert(!m && !num);
|
||||
|
||||
memset(num, 0, sizeof(epg_episode_num_t));
|
||||
|
||||
if (!htsmsg_get_u32(m, "e_num", &u32))
|
||||
num->e_num = u32;
|
||||
if (!htsmsg_get_u32(m, "e_cnt", &u32))
|
||||
|
@ -791,7 +790,6 @@ static epg_episode_num_t *epg_episode_num_deserialize
|
|||
num->p_cnt = u32;
|
||||
if ((str = htsmsg_get_str(m, "text")))
|
||||
num->text = strdup(str);
|
||||
return num;
|
||||
}
|
||||
|
||||
static void _epg_episode_destroy ( void *eo )
|
||||
|
|
Loading…
Add table
Reference in a new issue