[vlc-devel] commit: QT4_extenssions: replace qstrdup by strdup. ( Rémi Duraffort )
git version control
git at videolan.org
Sun Jan 24 17:20:58 CET 2010
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Jan 24 16:29:41 2010 +0100| [c2282767004237ad3bc4d49ee58cddd31523c5a5] | committer: Rémi Duraffort
QT4_extenssions: replace qstrdup by strdup.
In fact qstrdup use new but the resulting memory can be deallocated by some C code.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2282767004237ad3bc4d49ee58cddd31523c5a5
---
modules/gui/qt4/dialogs/extensions.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/dialogs/extensions.cpp b/modules/gui/qt4/dialogs/extensions.cpp
index 82c8b48..e083386 100644
--- a/modules/gui/qt4/dialogs/extensions.cpp
+++ b/modules/gui/qt4/dialogs/extensions.cpp
@@ -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 )
{
More information about the vlc-devel
mailing list