Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix memleaks in descrambler and utils
  • Loading branch information
KyleSanderson authored and perexg committed Jun 27, 2015
1 parent 6bf1aba commit 2f1277b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/descrambler/descrambler.c
Expand Up @@ -217,8 +217,10 @@ descrambler_keys ( th_descrambler_t *td, int type,
uint16_t sid = ((mpegts_service_t *)td->td_service)->s_dvb_service_id;
uint32_t pos = 0, crc;
mpegts_mux_t *mm = ((mpegts_service_t *)td->td_service)->s_dvb_mux;
if (!mm->mm_active)
if (!mm->mm_active) {
free(tp);
return;
}
pthread_mutex_lock(&mm->mm_active->mmi_input->mi_output_lock);
tp->pos = mm->mm_tsdebug_pos;
memset(tp->pkt, 0xff, sizeof(tp->pkt));
Expand Down
4 changes: 3 additions & 1 deletion src/utils.c
Expand Up @@ -714,8 +714,10 @@ deferred_unlink(const char *filename, const char *rootdir)
tasklet_arm_alloc(deferred_unlink_cb, s);
else {
du = calloc(1, sizeof(*du));
if (du == NULL)
if (du == NULL) {
free(s);
return -ENOMEM;
}
du->filename = s;
du->rootdir = strdup(rootdir);
tasklet_arm_alloc(deferred_unlink_dir_cb, du);
Expand Down

0 comments on commit 2f1277b

Please sign in to comment.