Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
1656b527
Commit
1656b527
authored
Apr 01, 2007
by
Howard Chu
Browse files
ITS#4899 fix from HEAD
parent
f94d411f
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap_r/tpool.c
View file @
1656b527
...
...
@@ -596,13 +596,25 @@ int ldap_pvt_thread_pool_setkey(
if
(
!
ctx
||
!
key
)
return
EINVAL
;
for
(
i
=
0
;
i
<
MAXKEYS
;
i
++
)
{
if
(
!
ctx
[
i
].
ltk_key
||
ctx
[
i
].
ltk_key
==
key
)
{
if
(
data
||
kfree
)
if
(
(
data
&&
!
ctx
[
i
].
ltk_key
)
||
ctx
[
i
].
ltk_key
==
key
)
{
if
(
data
||
kfree
)
{
ctx
[
i
].
ltk_key
=
key
;
else
ctx
[
i
].
ltk_key
=
NULL
;
ctx
[
i
].
ltk_data
=
data
;
ctx
[
i
].
ltk_free
=
kfree
;
ctx
[
i
].
ltk_data
=
data
;
ctx
[
i
].
ltk_free
=
kfree
;
}
else
{
int
j
;
for
(
j
=
i
+
1
;
j
<
MAXKEYS
;
j
++
)
if
(
!
ctx
[
j
].
ltk_key
)
break
;
j
--
;
if
(
j
!=
i
)
{
ctx
[
i
].
ltk_key
=
ctx
[
j
].
ltk_key
;
ctx
[
i
].
ltk_data
=
ctx
[
j
].
ltk_data
;
ctx
[
i
].
ltk_free
=
ctx
[
j
].
ltk_free
;
}
ctx
[
j
].
ltk_key
=
NULL
;
ctx
[
j
].
ltk_data
=
NULL
;
ctx
[
j
].
ltk_free
=
NULL
;
}
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