]> git.sesse.net Git - vlc/commitdiff
QT4_extenssions: replace qstrdup by strdup.
authorRémi Duraffort <ivoire@videolan.org>
Sun, 24 Jan 2010 15:29:41 +0000 (16:29 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Sun, 24 Jan 2010 16:16:09 +0000 (17:16 +0100)
In fact qstrdup use new but the resulting memory can be deallocated by some C code.

modules/gui/qt4/dialogs/extensions.cpp

index 82c8b48902a14a0c7a0bb6641bac97e63d88e6d9..e0833861f8d0bf18e426ca5f8e4ed862b5aba251 100644 (file)
@@ -388,9 +388,9 @@ void ExtensionDialog::SyncInput( QObject *object )
             || p_widget->type == EXTENSION_WIDGET_PASSWORD );
     /* Synchronize psz_text with the new value */
     QLineEdit *widget = static_cast< QLineEdit* >( p_widget->p_sys_intf );
-    char *psz_text = qstrdup( qtu( widget->text() ) );
+    char *psz_text = widget->text().isNull() ? NULL : strdup( qtu( widget->text() ) );
     free( p_widget->psz_text );
-    p_widget->psz_text = psz_text;
+    p_widget->psz_text =  psz_text;
 
     if( lockedHere )
     {