sasl_security_properties_t *secprops )
{
int i, j, l;
- char **props = ldap_str2charray( in, "," );
+ char **props;
unsigned sflags = 0;
int got_sflags = 0;
sasl_ssf_t max_ssf = 0;
unsigned maxbufsize = 0;
int got_maxbufsize = 0;
- if( props == NULL || secprops == NULL ) {
+ if( secprops == NULL ) {
+ return LDAP_PARAM_ERROR;
+ }
+ props = ldap_str2charray( in, "," );
+ if( props == NULL ) {
return LDAP_PARAM_ERROR;
}
if ( !*extensions ) {
*extensions =
LDAP_CALLOC(2, sizeof(LDAPSchemaExtensionItem *));
- if ( !*extensions )
- return 1;
+ if ( !*extensions ) {
+ LDAP_FREE( ext );
+ return 1;
+ }
n = 0;
} else {
for ( n=0; (*extensions)[n] != NULL; n++ )
;
tmp = LDAP_REALLOC(*extensions,
(n+2)*sizeof(LDAPSchemaExtensionItem *));
- if ( !tmp )
+ if ( !tmp ) {
+ LDAP_FREE( ext );
return 1;
+ }
*extensions = tmp;
}
(*extensions)[n] = ext;
6 ) == 0 ) {
if ( file_read( tmp.mod_values[i] + 6,
bvals[i] ) < 0 ) {
+ free( bvals );
+ for ( i = 0; i<num; i++ )
+ free( result[ i ] );
+ free( result );
return( NULL );
}
} else {
specs[i] = ludp->lud_host;
ludp->lud_host = p;
p = strchr( ludp->lud_host, ']' );
- if ( p == NULL )
+ if ( p == NULL ) {
+ LDAP_FREE(ludp);
+ ldap_charray_free(specs);
return LDAP_PARAM_ERROR;
+ }
*p++ = '\0';
if ( *p != ':' ) {
- if ( *p != '\0' )
+ if ( *p != '\0' ) {
+ LDAP_FREE(ludp);
+ ldap_charray_free(specs);
return LDAP_PARAM_ERROR;
+ }
p = NULL;
}
} else {
ldap_pvt_hex_unescape(p);
ludp->lud_port = strtol( p, &next, 10 );
if ( next == p || next[0] != '\0' ) {
+ LDAP_FREE(ludp);
+ ldap_charray_free(specs);
return LDAP_PARAM_ERROR;
}
}