From: Adam Sutton Date: Sun, 10 Jan 2016 00:15:54 +0000 (+0000) Subject: input: fix possible memory leak X-Git-Tag: v4.2.1~1163^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a1660844edf5f16ccdf94364b435c530a40d824;p=thirdparty%2Ftvheadend.git input: fix possible memory leak This might never happen, but loop to check for existing owner would then be redundant. --- diff --git a/src/input/mpegts/mpegts_input.c b/src/input/mpegts/mpegts_input.c index 207f5a2e5..796fa96e8 100644 --- a/src/input/mpegts/mpegts_input.c +++ b/src/input/mpegts/mpegts_input.c @@ -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; @@ -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; }