]> git.sesse.net Git - vlc/commitdiff
Qt: Simple prefs/input: fix variable handling
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 1 Oct 2009 16:12:14 +0000 (18:12 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 4 Oct 2009 16:04:26 +0000 (18:04 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/simple_preferences.cpp

index c1ecda96729f4bce489859b76e9b79004a376f7f..6f98fe25a030466f84fc687197a1383f669d908b 100644 (file)
@@ -719,13 +719,14 @@ void SPrefsPanel::apply()
     case SPrefsInputAndCodecs:
     {
         /* Device default selection */
-        const char *psz_devicepath =
-              qtu( qobject_cast<QLineEdit *>(optionWidgets[inputLE] )->text() );
+        char *psz_devicepath =
+            strdup( qtu( qobject_cast<QLineEdit *>(optionWidgets[inputLE] )->text() ) );
         if( !EMPTY_STR( psz_devicepath ) )
         {
             config_PutPsz( p_intf, "dvd", psz_devicepath );
             config_PutPsz( p_intf, "vcd", psz_devicepath );
             config_PutPsz( p_intf, "cd-audio", psz_devicepath );
+            free( psz_devicepath );
         }
 
 #define CaCi( name, int ) config_PutInt( p_intf, name, int * i_comboValue )