Commit 4775b482 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Atmo: fix memleak introduced by 59f746f6

parent 14de778f
...@@ -1848,18 +1848,19 @@ static void Atmo_SetupParameters(filter_t *p_filter) ...@@ -1848,18 +1848,19 @@ static void Atmo_SetupParameters(filter_t *p_filter)
COM Server for AtmoLight not running ? COM Server for AtmoLight not running ?
if the exe path is configured try to start the "userspace" driver if the exe path is configured try to start the "userspace" driver
*/ */
LPTSTR psz_path = ToT(var_CreateGetStringCommand( p_filter, char *psz_path = var_CreateGetStringCommand( p_filter,
CFG_PREFIX "atmowinexe" )); CFG_PREFIX "atmowinexe" );
LPTSTR ptsz_path = ToT(psz_path);
if(psz_path != NULL) if(psz_path != NULL)
{ {
STARTUPINFO startupinfo; STARTUPINFO startupinfo;
PROCESS_INFORMATION pinfo; PROCESS_INFORMATION pinfo;
memset(&startupinfo, 0, sizeof(STARTUPINFO)); memset(&startupinfo, 0, sizeof(STARTUPINFO));
startupinfo.cb = 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) 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); WaitForInputIdle(pinfo.hProcess, 5000);
/* /*
retry to initialize the library COM ... functionality retry to initialize the library COM ... functionality
...@@ -1867,9 +1868,10 @@ static void Atmo_SetupParameters(filter_t *p_filter) ...@@ -1867,9 +1868,10 @@ static void Atmo_SetupParameters(filter_t *p_filter)
*/ */
i = AtmoInitialize(p_filter, false); i = AtmoInitialize(p_filter, false);
} else { } 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(psz_path);
free(ptsz_path);
} }
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment