]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
input: fix possible memory leak
authorAdam Sutton <dev@adamsutton.me.uk>
Sun, 10 Jan 2016 00:15:54 +0000 (00:15 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Sun, 10 Jan 2016 18:01:33 +0000 (18:01 +0000)
This might never happen, but loop to check for existing owner would then
be redundant.

src/input/mpegts/mpegts_input.c

index 207f5a2e5d08cc55faa3e04fb3566fa065e6d188..796fa96e8c8d6aaa337300d0ea3c48bd45f36c9f 100644 (file)
@@ -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;
     }