[Date Prev][Date Next]
FW: syncrepl.c uses strndup() (ITS#2481)
[mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of
Full_Name: Hallvard B. Furuseth
Submission from: (NULL) (22.214.171.124)
syncrepl.c uses the function strndup(), which does not exist.
ber_strndup(), ber_strndup_x(), LBER_STRNDUP(), LDAP_STRNDUP(),
LDAP_STRNDUPX() and SLAP_STRNDUP() exist, I don't know which
one is supposed to be used.
The LDAP_STR* macros are for libldap's internal use. Likewise the LBER_STR*
macros are only for use within liblber.
Of the func() vs func_x() variant, the plain func just calls func_x with a
NULL context to get the regular global malloc, and is provided for backward
compatibility. I've been using the _x functions directly in places, to avoid
the extra function call, but you really only need it if you want the
allocation to come from the thread-local memory context. In this particular
case, the strndup's appear to be for values that must come from regular
malloc, so using a NULL memory context would be correct. I guess Jong should
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
Symas: Premier OpenSource Development and Support