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
93b88e0b
Commit
93b88e0b
authored
May 13, 2006
by
Pierangelo Masarati
Browse files
make sure realloc'd memory is reset
parent
680b98ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-meta/conn.c
View file @
93b88e0b
...
...
@@ -754,9 +754,11 @@ meta_back_candidates_get( Operation *op )
}
else
if
(
mc
->
mc_ntargets
<
mi
->
mi_ntargets
)
{
/* NOTE: in the future, may want to allow back-config
* to add/remove targets from back-meta... */
mc
->
mc_ntargets
=
mi
->
mi_ntargets
;
mc
->
mc_candidates
=
ch_realloc
(
mc
->
mc_candidates
,
sizeof
(
SlapReply
)
*
mc
->
mc_ntargets
);
sizeof
(
SlapReply
)
*
mi
->
mi_ntargets
);
memset
(
&
mc
->
mc_candidates
[
mc
->
mc_ntargets
],
0
,
sizeof
(
SlapReply
)
*
(
mi
->
mi_ntargets
-
mc
->
mc_ntargets
)
);
mc
->
mc_ntargets
=
mi
->
mi_ntargets
;
}
return
mc
->
mc_candidates
;
...
...
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