[libdvbpsi-devel] dvbinfo: Fix resource leak (CID: 17271)

Jean-Paul Saman git at videolan.org
Wed Apr 16 15:53:31 CEST 2014


libdvbpsi | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri Apr 11 15:09:34 2014 +0200| [63c868ec929fd07064fc216507487534f70261f2] | committer: Jean-Paul Saman

dvbinfo: Fix resource leak (CID: 17271)

The error path for dvbpsi_AttachDemux() in handle_atsc_MGT failed to release
allocated resources.

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=63c868ec929fd07064fc216507487534f70261f2
---

 examples/dvbinfo/libdvbpsi.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/dvbinfo/libdvbpsi.c b/examples/dvbinfo/libdvbpsi.c
index c502bcb..b31a920 100644
--- a/examples/dvbinfo/libdvbpsi.c
+++ b/examples/dvbinfo/libdvbpsi.c
@@ -1703,6 +1703,8 @@ static void handle_atsc_MGT(void *p_data, dvbpsi_atsc_mgt_t *p_mgt)
             if (!dvbpsi_AttachDemux(p->handle, handle_subtable, p_stream))
             {
                  fprintf(stderr, "dvbinfo: Failed to attach new ATSC EIT decoder\n");
+                 dvbpsi_delete(p->handle);
+                 free(p);
                  break;
             }
 



More information about the libdvbpsi-devel mailing list