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

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:05:46 2014 +0200| [217d71c43b0671532f77755022ba801fa7e93ad7] | committer: Jean-Paul Saman

dvbinfo: Fix resource leak (CID: 17270)

The error path for dvbpsi_pmt_attach() in handle_PAT failed to release
allocated resources.

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

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

diff --git a/examples/dvbinfo/libdvbpsi.c b/examples/dvbinfo/libdvbpsi.c
index b902988..c502bcb 100644
--- a/examples/dvbinfo/libdvbpsi.c
+++ b/examples/dvbinfo/libdvbpsi.c
@@ -748,6 +748,8 @@ static void handle_PAT(void* p_data, dvbpsi_pat_t* p_pat)
             if (!dvbpsi_pmt_attach(p_pmt->handle, p_program->i_number, handle_PMT, p_stream))
             {
                  fprintf(stderr, "dvbinfo: Failed to attach new pmt decoder\n");
+                 dvbpsi_delete(p_pmt->handle);
+                 free(p_pmt);
                  break;
             }
 



More information about the libdvbpsi-devel mailing list