[vlc-commits] atmo: memory leak

Rémi Denis-Courmont git at videolan.org
Wed Apr 23 22:40:02 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 23 23:39:57 2014 +0300| [e39e93a44ff63aa2937cc8f196f9584cc5d9c6d2] | committer: Rémi Denis-Courmont

atmo: memory leak

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e39e93a44ff63aa2937cc8f196f9584cc5d9c6d2
---

 modules/video_filter/atmo/AtmoChannelAssignment.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_filter/atmo/AtmoChannelAssignment.cpp b/modules/video_filter/atmo/AtmoChannelAssignment.cpp
index f79c9aa..6b276df 100644
--- a/modules/video_filter/atmo/AtmoChannelAssignment.cpp
+++ b/modules/video_filter/atmo/AtmoChannelAssignment.cpp
@@ -35,6 +35,7 @@ CAtmoChannelAssignment::CAtmoChannelAssignment(CAtmoChannelAssignment &source)
 
 CAtmoChannelAssignment::~CAtmoChannelAssignment(void)
 {
+  delete[] m_mappings;
   free(m_psz_name);
 }
 
@@ -48,14 +49,15 @@ void CAtmoChannelAssignment::setSize(int numChannels)
 {
   if(numChannels != m_num_channels)
   {
-     delete []m_mappings;
-     m_mappings = NULL;
+     delete[] m_mappings;
      m_num_channels = numChannels;
      if(m_num_channels > 0)
      {
        m_mappings = new int[m_num_channels];
        memset(m_mappings, 0, sizeof(int) * m_num_channels);
      }
+     else
+       m_mappings = NULL;
   }
 }
 



More information about the vlc-commits mailing list