[vlc-devel] commit: DShow: don't leak device name. (Jean-Baptiste Kempf )

git version control git at videolan.org
Wed Jun 10 14:36:37 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun 10 14:36:13 2009 +0200| [b24fc9a9680a2e62d1a3f660a7c20f5c9ba5cdb2] | committer: Jean-Baptiste Kempf 

DShow: don't leak device name.

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

 modules/access/dshow/dshow.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index eb5d2da..729a9ea 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -2008,7 +2008,7 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
 {
     module_config_t *p_item;
     bool b_audio = false;
-    const char *psz_device = NULL;
+    char *psz_device = NULL;
 
     if( !EMPTY_STR( newval.psz_string ) )
         psz_device = strdup( newval.psz_string );
@@ -2052,12 +2052,14 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
         CoUninitialize();
 
         msg_Err( p_this, "didn't find device: %s", devicename.c_str() );
+        free( psz_device );
         return VLC_EGENERIC;
     }
 
     /* Uninitialize OLE/COM */
     CoUninitialize();
 
+    free( psz_device );
     return VLC_SUCCESS;
 }
 




More information about the vlc-devel mailing list