[vlc-commits] Qt: fix memory leaks

Hannes Domani git at videolan.org
Mon Jul 6 19:23:19 CEST 2015


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

Qt: fix memory leaks

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 ccb5ba3..9e89780 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -386,13 +386,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