Ticket #7152: libs_libmythtv-memory-leaks

File libs_libmythtv-memory-leaks, 2.1 KB (added by Erik Hovland <erik@…>, 10 years ago)

Fix memory leaks in the error path of a few functions

Line 
1Plug all memory leaks
2
3From: Erik Hovland <erik@hovland.org>
4
5
6---
7
8 mythtv/libs/libmythtv/NuppelVideoRecorder.cpp      |    2 ++
9 .../libs/libmythtv/channelscan/channelscan_sm.cpp  |    2 ++
10 mythtv/libs/libmythtv/openglvideo.cpp              |    1 +
11 3 files changed, 5 insertions(+), 0 deletions(-)
12
13
14diff --git a/mythtv/libs/libmythtv/NuppelVideoRecorder.cpp b/mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
15index f2a5389..459b3e6 100644
16--- a/mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
17+++ b/mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
18@@ -2593,6 +2593,7 @@ void NuppelVideoRecorder::doVbiThread(void)
19         {
20             VERBOSE(VB_IMPORTANT, LOC_ERR +
21                     "Failed to query vbi capabilities (v4l1)");
22+            delete ntsc_cc;
23             return;
24         }
25         VERBOSE(VB_RECORD, LOC + "vbi_format  rate: "<<vfmt.sampling_rate
26@@ -2614,6 +2615,7 @@ void NuppelVideoRecorder::doVbiThread(void)
27         {
28             VERBOSE(VB_IMPORTANT, LOC_ERR +
29                     "VBI format has too many samples per frame");
30+            delete ntsc_cc;
31             return;
32         }
33     }
34diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
35index 20d6467..b972c8b 100644
36--- a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
37+++ b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
38@@ -924,6 +924,8 @@ static void update_info(ChannelInsertInfo &info,
39     info.is_data_service =
40         (desc && !desc->IsDTV() && !desc->IsDigitalAudio());
41     info.is_audio_service = (desc && desc->IsDigitalAudio());
42+    if (desc)
43+        delete desc;
44 
45     info.sdt_tsid   = sdt->TSID();
46     info.orig_netid = sdt->OriginalNetworkID();
47diff --git a/mythtv/libs/libmythtv/openglvideo.cpp b/mythtv/libs/libmythtv/openglvideo.cpp
48index ce8dfc8..48ef4bc 100644
49--- a/mythtv/libs/libmythtv/openglvideo.cpp
50+++ b/mythtv/libs/libmythtv/openglvideo.cpp
51@@ -507,6 +507,7 @@ bool OpenGLVideo::AddFilter(OpenGLFilterType filter)
52 
53     RemoveFilter(filter);
54     filters.erase(filter);
55+    delete temp;
56 
57     return false;
58 }