Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e130ef40
Commit
e130ef40
authored
Sep 24, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Sep 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sc: Use CRT allocation functions.
parent
33ce8e04
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
sc.c
programs/sc/sc.c
+5
-6
No files found.
programs/sc/sc.c
View file @
e130ef40
...
...
@@ -135,10 +135,9 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f
unsigned
int
i
,
count
;
WCHAR
*
actions
,
*
p
;
actions
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
arg
)
+
1
)
*
sizeof
(
WCHAR
)
);
actions
=
wcsdup
(
arg
);
if
(
!
actions
)
return
FALSE
;
lstrcpyW
(
actions
,
arg
);
for
(
p
=
actions
,
count
=
0
;
*
p
;
p
++
)
{
if
(
*
p
==
'/'
)
...
...
@@ -150,10 +149,10 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f
count
=
count
/
2
+
1
;
fa
->
cActions
=
count
;
fa
->
lpsaActions
=
HeapAlloc
(
GetProcessHeap
(),
0
,
fa
->
cActions
*
sizeof
(
SC_ACTION
)
);
fa
->
lpsaActions
=
malloc
(
fa
->
cActions
*
sizeof
(
SC_ACTION
)
);
if
(
!
fa
->
lpsaActions
)
{
HeapFree
(
GetProcessHeap
(),
0
,
actions
);
free
(
actions
);
return
FALSE
;
}
...
...
@@ -170,7 +169,7 @@ static BOOL parse_failure_actions( const WCHAR *arg, SERVICE_FAILURE_ACTIONSW *f
p
+=
lstrlenW
(
p
)
+
1
;
}
HeapFree
(
GetProcessHeap
(),
0
,
actions
);
free
(
actions
);
return
TRUE
;
}
...
...
@@ -333,7 +332,7 @@ int __cdecl wmain( int argc, const WCHAR *argv[] )
{
ret
=
ChangeServiceConfig2W
(
service
,
SERVICE_CONFIG_FAILURE_ACTIONS
,
&
sfa
);
if
(
!
ret
)
WINE_ERR
(
"failed to set service failure actions %lu
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
sfa
.
lpsaActions
);
free
(
sfa
.
lpsaActions
);
}
else
WINE_ERR
(
"failed to parse failure parameters
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment