Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marvin Scholz
Icecast-Server
Commits
857264ac
Commit
857264ac
authored
Dec 20, 2014
by
Philipp Schafft
🦁
Browse files
Fix: memory leak and race condition fix
parent
2a99aa0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/auth.c
View file @
857264ac
...
...
@@ -613,6 +613,7 @@ void auth_stack_release(auth_stack_t *stack) {
return
;
auth_release
(
stack
->
auth
);
auth_stack_release
(
stack
->
next
);
thread_mutex_destroy
(
&
stack
->
lock
);
free
(
stack
);
}
...
...
@@ -631,9 +632,9 @@ int auth_stack_next(auth_stack_t **stack) {
return
-
1
;
thread_mutex_lock
(
&
(
*
stack
)
->
lock
);
next
=
(
*
stack
)
->
next
;
auth_stack_addref
(
next
);
thread_mutex_unlock
(
&
(
*
stack
)
->
lock
);
auth_stack_release
(
*
stack
);
auth_stack_addref
(
next
);
*
stack
=
next
;
if
(
!
next
)
return
1
;
...
...
@@ -656,7 +657,9 @@ int auth_stack_push(auth_stack_t **stack, auth_t *auth) {
auth_addref
(
auth
);
if
(
*
stack
)
{
return
auth_stack_append
(
*
stack
,
next
);
auth_stack_append
(
*
stack
,
next
);
auth_stack_release
(
next
);
return
0
;
}
else
{
*
stack
=
next
;
return
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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