[vlc-commits] Atmo: fix memleak introduced by 59f746f6

Jean-Baptiste Kempf git at videolan.org
Tue Jan 15 11:47:36 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jan 15 11:46:01 2013 +0100| [4775b4824b69f4edbe5d65b6b618a4f46d0e6c97] | committer: Jean-Baptiste Kempf

Atmo: fix memleak introduced by 59f746f6

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

 modules/video_filter/atmo/atmo.cpp |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/video_filter/atmo/atmo.cpp b/modules/video_filter/atmo/atmo.cpp
index e430796..b9bf3fb 100644
--- a/modules/video_filter/atmo/atmo.cpp
+++ b/modules/video_filter/atmo/atmo.cpp
@@ -1848,18 +1848,19 @@ static void Atmo_SetupParameters(filter_t *p_filter)
           COM Server for AtmoLight not running ?
           if the exe path is configured try to start the "userspace" driver
         */
-        LPTSTR psz_path = ToT(var_CreateGetStringCommand( p_filter,
-                                               CFG_PREFIX "atmowinexe" ));
+        char *psz_path = var_CreateGetStringCommand( p_filter,
+                                               CFG_PREFIX "atmowinexe" );
+        LPTSTR ptsz_path = ToT(psz_path);
         if(psz_path != NULL)
         {
             STARTUPINFO startupinfo;
             PROCESS_INFORMATION pinfo;
             memset(&startupinfo, 0, sizeof(STARTUPINFO));
             startupinfo.cb = sizeof(STARTUPINFO);
-            if(CreateProcess(psz_path, NULL, NULL, NULL,
+            if(CreateProcess(ptsz_path, NULL, NULL, NULL,
                 FALSE, 0, NULL, NULL, &startupinfo, &pinfo) == TRUE)
             {
-                msg_Dbg(p_filter,"launched AtmoWin from %s", FromT(psz_path));
+                msg_Dbg(p_filter,"launched AtmoWin from %s", psz_path);
                 WaitForInputIdle(pinfo.hProcess, 5000);
                 /*
                   retry to initialize the library COM ... functionality
@@ -1867,9 +1868,10 @@ static void Atmo_SetupParameters(filter_t *p_filter)
                 */
                 i = AtmoInitialize(p_filter, false);
             } else {
-                msg_Err(p_filter,"failed to launch AtmoWin from %s", FromT(psz_path));
+                msg_Err(p_filter,"failed to launch AtmoWin from %s", psz_path);
             }
             free(psz_path);
+            free(ptsz_path);
         }
     }
 #endif



More information about the vlc-commits mailing list