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
3d416910
Commit
3d416910
authored
Nov 01, 2013
by
Howard Chu
Committed by
Quanah Gibson-Mount
Nov 05, 2013
Browse files
ITS
#7735
plug memleak
Introduced in commit
48cdd54d
parent
08c3ab2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/ldapsync.c
View file @
3d416910
...
...
@@ -370,6 +370,23 @@ slap_parse_sync_cookie(
return
0
;
}
/* count the numcsns and regenerate the list of SIDs in a recomposed cookie */
void
slap_reparse_sync_cookie
(
struct
sync_cookie
*
cookie
,
void
*
memctx
)
{
if
(
cookie
->
ctxcsn
)
{
for
(;
!
BER_BVISNULL
(
&
cookie
->
ctxcsn
[
cookie
->
numcsns
]
);
cookie
->
numcsns
++
);
}
if
(
cookie
->
numcsns
)
{
cookie
->
sids
=
slap_parse_csn_sids
(
cookie
->
ctxcsn
,
cookie
->
numcsns
,
memctx
);
if
(
cookie
->
numcsns
>
1
)
slap_sort_csn_sids
(
cookie
->
ctxcsn
,
cookie
->
sids
,
cookie
->
numcsns
,
memctx
);
}
}
int
slap_init_sync_cookie_ctxcsn
(
struct
sync_cookie
*
cookie
...
...
servers/slapd/proto-slap.h
View file @
3d416910
...
...
@@ -1176,6 +1176,8 @@ LDAP_SLAPD_F (void) slap_insert_csn_sids LDAP_P((
struct
sync_cookie
*
ck
,
int
,
int
,
struct
berval
*
));
LDAP_SLAPD_F
(
int
)
slap_parse_sync_cookie
LDAP_P
((
struct
sync_cookie
*
,
void
*
memctx
));
LDAP_SLAPD_F
(
int
)
slap_reparse_sync_cookie
LDAP_P
((
struct
sync_cookie
*
,
void
*
memctx
));
LDAP_SLAPD_F
(
int
)
slap_init_sync_cookie_ctxcsn
LDAP_P
((
struct
sync_cookie
*
));
LDAP_SLAPD_F
(
struct
sync_cookie
*
)
slap_dup_sync_cookie
LDAP_P
((
...
...
servers/slapd/syncrepl.c
View file @
3d416910
...
...
@@ -590,7 +590,8 @@ check_syncprov(
slap_compose_sync_cookie
(
NULL
,
&
si
->
si_syncCookie
.
octet_str
,
si
->
si_syncCookie
.
ctxcsn
,
si
->
si_syncCookie
.
rid
,
si
->
si_syncCookie
.
sid
);
slap_parse_sync_cookie
(
&
si
->
si_syncCookie
,
NULL
);
ch_free
(
si
->
si_syncCookie
.
sids
);
slap_reparse_sync_cookie
(
&
si
->
si_syncCookie
,
op
->
o_tmpmemctx
);
}
ldap_pvt_thread_mutex_unlock
(
&
si
->
si_cookieState
->
cs_mutex
);
return
changed
;
...
...
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