mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Use ber_mem* functions.
This commit is contained in:
parent
c581055b54
commit
68e64e768b
@ -597,14 +597,14 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( pmods == NULL || pmods[ i ] == NULL ) {
|
if ( pmods == NULL || pmods[ i ] == NULL ) {
|
||||||
if (( pmods = (LDAPMod **)realloc( pmods, (i + 2) *
|
if (( pmods = (LDAPMod **)ber_memrealloc( pmods, (i + 2) *
|
||||||
sizeof( LDAPMod * ))) == NULL ) {
|
sizeof( LDAPMod * ))) == NULL ) {
|
||||||
perror( "realloc" );
|
perror( "realloc" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
*pmodsp = pmods;
|
*pmodsp = pmods;
|
||||||
pmods[ i + 1 ] = NULL;
|
pmods[ i + 1 ] = NULL;
|
||||||
if (( pmods[ i ] = (LDAPMod *)calloc( 1, sizeof( LDAPMod )))
|
if (( pmods[ i ] = (LDAPMod *)ber_memcalloc( 1, sizeof( LDAPMod )))
|
||||||
== NULL ) {
|
== NULL ) {
|
||||||
perror( "calloc" );
|
perror( "calloc" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
@ -643,7 +643,7 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen )
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bvp->bv_len = vlen;
|
bvp->bv_len = vlen;
|
||||||
if (( bvp->bv_val = (char *)malloc( vlen + 1 )) == NULL ) {
|
if (( bvp->bv_val = (char *)ber_memalloc( vlen + 1 )) == NULL ) {
|
||||||
perror( "malloc" );
|
perror( "malloc" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user