Commit f4a428d0 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

cleanup

parent 2954a904
......@@ -23,7 +23,6 @@
#include "slap.h"
#if SLAPD_OVER_CHAIN == SLAPD_MOD_STATIC
extern int chain_init();
#endif
......
......@@ -667,11 +667,13 @@ rwm_send_entry( Operation *op, SlapReply *rs )
* - attributes that are requested
* - no values if attrsonly is set
*/
e = entry_dup( e );
if ( e == NULL ) {
rc = LDAP_NO_MEMORY;
goto fail;
}
rs->sr_flags |= ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED );
}
......@@ -1013,12 +1015,12 @@ rwm_config(
int rc = 0;
char *argv0 = NULL;
if ( strncasecmp( argv[ 0 ], "rwm-", sizeof( "rwm-" ) - 1 ) == 0 ) {
if ( strncasecmp( argv[ 0 ], "rwm-", STRLENOF( "rwm-" ) ) == 0 ) {
argv0 = argv[ 0 ];
argv[ 0 ] = &argv0[ sizeof( "rwm-" ) - 1 ];
argv[ 0 ] = &argv0[ STRLENOF( "rwm-" ) ];
}
if ( strncasecmp( argv[0], "rewrite", sizeof("rewrite") - 1 ) == 0 ) {
if ( strncasecmp( argv[0], "rewrite", STRLENOF("rewrite") ) == 0 ) {
rc = rwm_rw_config( be, fname, lineno, argc, argv );
} else if ( strcasecmp( argv[0], "map" ) == 0 ) {
......
......@@ -270,13 +270,13 @@ rwm_suffix_massage_patternize( const char *s )
len = strlen( s );
res = ch_calloc( sizeof( char ), len + sizeof( "%1" ) );
res = ch_calloc( sizeof( char ), len + STRLENOF( "%1" ) + 1 );
if ( res == NULL ) {
return NULL;
}
strcpy( res, "%1" );
strcpy( res + sizeof( "%1" ) - 1, s );
strcpy( res + STRLENOF( "%1" ), s );
return res;
}
......
......@@ -78,7 +78,7 @@ rwm_map_init( struct ldapmap *lm, struct ldapmapping **m )
mapping = (struct ldapmapping *)ch_calloc( 2,
sizeof( struct ldapmapping ) );
if ( mapping == NULL ) {
return;
return LDAP_NO_MEMORY;
}
rc = slap_str2ad( "objectClass", &mapping->m_src_ad, &text );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment