From 2cee8e42859d99895603f5617ce7dee6c3beaa93 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Thu, 1 Oct 2009 18:12:14 +0200 Subject: [PATCH] Qt: Simple prefs/input: fix variable handling Signed-off-by: Jean-Baptiste Kempf --- modules/gui/qt4/components/simple_preferences.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp index c1ecda9672..6f98fe25a0 100644 --- a/modules/gui/qt4/components/simple_preferences.cpp +++ b/modules/gui/qt4/components/simple_preferences.cpp @@ -719,13 +719,14 @@ void SPrefsPanel::apply() case SPrefsInputAndCodecs: { /* Device default selection */ - const char *psz_devicepath = - qtu( qobject_cast(optionWidgets[inputLE] )->text() ); + char *psz_devicepath = + strdup( qtu( qobject_cast(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 ) -- 2.39.2