[vlc-commits] Qt: fix memory leaks

Hannes Domani git at videolan.org
Wed Oct 21 18:16:23 CEST 2015


vlc/vlc-2.2 | branch: master | Hannes Domani <ssbssa at yahoo.de> | Fri Jul  3 14:33:20 2015 +0200| [6b19dc464b89ddfdf7626c0556145bfb9c8ad71a] | committer: Jean-Baptiste Kempf

Qt: fix memory leaks

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit c64f324d74f86aa478c805a96584ec8adfb0f16d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/components/open_panels.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index e9b9a1d..e0b0b06 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -385,13 +385,15 @@ void DiscOpenPanel::onFocus()
                 wchar_t psz_name[512] = L"";
                 GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 );
 
-                QString displayName = FromWide( drive );
+                char *psz_drive = FromWide( drive );
+                QString displayName = psz_drive;
                 char *psz_title = FromWide( psz_name );
                 if( !EMPTY_STR(psz_title)) {
                     displayName = displayName + " - "  + psz_title;
                 }
 
-                ui.deviceCombo->addItem( displayName, FromWide( drive ) );
+                ui.deviceCombo->addItem( displayName, psz_drive );
+                free( psz_drive );
                 free( psz_title );
             }
 



More information about the vlc-commits mailing list