Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
input: fix possible memory leak
This might never happen, but loop to check for existing owner would then
be redundant.
  • Loading branch information
adamsutton committed Jan 10, 2016
1 parent dfae393 commit 5a16608
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/input/mpegts/mpegts_input.c
Expand Up @@ -475,6 +475,12 @@ mpegts_input_open_pid
tvhdebug("mpegts", "%s - open PID %s subscription [%04x/%p]",
buf, (type & MPS_TABLES) ? "tables" : "fullmux", type, owner);
mm->mm_update_pids_flag = 1;
} else {
tvherror("mpegts",
"%s - open PID %04x (%d) failed, dupe sub (owner %p)",
buf, mp->mp_pid, mp->mp_pid, owner);
free(mps);
mp = NULL;
}
} else if (!RB_INSERT_SORTED(&mp->mp_subs, mps, mps_link, mpegts_mps_cmp)) {
mp->mp_type |= type;
Expand All @@ -487,6 +493,8 @@ mpegts_input_open_pid
buf, mp->mp_pid, mp->mp_pid, type, owner);
mm->mm_update_pids_flag = 1;
} else {
tvherror("mpegts", "%s - open PID %04x (%d) failed, dupe sub (owner %p)",
buf, mp->mp_pid, mp->mp_pid, owner);
free(mps);
mp = NULL;
}
Expand Down

0 comments on commit 5a16608

Please sign in to comment.