mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 09:09:54 -05:00
Fix slapi_str2entry()/slapi_entry2str() allocation
This commit is contained in:
parent
6461a5b7fd
commit
2e36d49a73
1 changed files with 6 additions and 12 deletions
|
|
@ -110,16 +110,7 @@ slapi_str2entry(
|
|||
char *s,
|
||||
int flags )
|
||||
{
|
||||
Slapi_Entry *e = NULL;
|
||||
char *pTmpS;
|
||||
|
||||
pTmpS = slapi_ch_strdup( s );
|
||||
if ( pTmpS != NULL ) {
|
||||
e = str2entry( pTmpS );
|
||||
slapi_ch_free( (void **)&pTmpS );
|
||||
}
|
||||
|
||||
return e;
|
||||
return str2entry( s );
|
||||
}
|
||||
|
||||
char *
|
||||
|
|
@ -127,10 +118,13 @@ slapi_entry2str(
|
|||
Slapi_Entry *e,
|
||||
int *len )
|
||||
{
|
||||
char *ret;
|
||||
char *ret = NULL;
|
||||
char *s;
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &entry2str_mutex );
|
||||
ret = entry2str( e, len );
|
||||
s = entry2str( e, len );
|
||||
if ( s != NULL )
|
||||
ret = slapi_ch_strdup( s );
|
||||
ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue