Commit e130ef40 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

sc: Use CRT allocation functions.

parent 33ce8e04
...@@ -135,10 +135,9 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f ...@@ -135,10 +135,9 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f
unsigned int i, count; unsigned int i, count;
WCHAR *actions, *p; WCHAR *actions, *p;
actions = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( arg ) + 1) * sizeof(WCHAR) ); actions = wcsdup( arg );
if (!actions) return FALSE; if (!actions) return FALSE;
lstrcpyW( actions, arg );
for (p = actions, count = 0; *p; p++) for (p = actions, count = 0; *p; p++)
{ {
if (*p == '/') if (*p == '/')
...@@ -150,10 +149,10 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f ...@@ -150,10 +149,10 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f
count = count / 2 + 1; count = count / 2 + 1;
fa->cActions = count; fa->cActions = count;
fa->lpsaActions = HeapAlloc( GetProcessHeap(), 0, fa->cActions * sizeof(SC_ACTION) ); fa->lpsaActions = malloc( fa->cActions * sizeof(SC_ACTION) );
if (!fa->lpsaActions) if (!fa->lpsaActions)
{ {
HeapFree( GetProcessHeap(), 0, actions ); free( actions );
return FALSE; return FALSE;
} }
...@@ -170,7 +169,7 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f ...@@ -170,7 +169,7 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f
p += lstrlenW( p ) + 1; p += lstrlenW( p ) + 1;
} }
HeapFree( GetProcessHeap(), 0, actions ); free( actions );
return TRUE; return TRUE;
} }
...@@ -333,7 +332,7 @@ int __cdecl wmain( int argc, const WCHAR *argv[] ) ...@@ -333,7 +332,7 @@ int __cdecl wmain( int argc, const WCHAR *argv[] )
{ {
ret = ChangeServiceConfig2W( service, SERVICE_CONFIG_FAILURE_ACTIONS, &sfa ); ret = ChangeServiceConfig2W( service, SERVICE_CONFIG_FAILURE_ACTIONS, &sfa );
if (!ret) WINE_ERR("failed to set service failure actions %lu\n", GetLastError()); if (!ret) WINE_ERR("failed to set service failure actions %lu\n", GetLastError());
HeapFree( GetProcessHeap(), 0, sfa.lpsaActions ); free( sfa.lpsaActions );
} }
else else
WINE_ERR("failed to parse failure parameters\n"); WINE_ERR("failed to parse failure parameters\n");
......
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