break;
}
}
- if( dn->bv_val[i] != '\'' ) {
- return LDAP_INVALID_SYNTAX;
- }
- if( dn->bv_val[i-1] != 'B' ) {
- return LDAP_INVALID_SYNTAX;
- }
- if( dn->bv_val[i-2] != '#' ) {
+ if( dn->bv_val[i] != '\'' ||
+ dn->bv_val[i-1] != 'B' ||
+ dn->bv_val[i-2] != '#' ) {
+ ber_bvfree( dn );
return LDAP_INVALID_SYNTAX;
}
return nsa;
err:
- ch_free( nsa->sa_final );
+ ber_bvfree( nsa->sa_final );
ber_bvecfree( nsa->sa_any );
- ch_free( nsa->sa_initial );
+ ber_bvfree( nsa->sa_initial );
ch_free( nsa );
return NULL;
}
struct berval *value,
void *assertedValue )
{
- char *val, *assertv, **values, **words, *c;
+ char *val, *nval, *assertv, **values, **words, *c;
int i, count, len, nextchunk=0, nextavail=0;
size_t avlen;
/* Yes, this is necessary */
- val = UTF8normalize( value->bv_val, UTF8_NOCASEFOLD );
- if( val == NULL ) {
+ nval = UTF8normalize( value->bv_val, UTF8_NOCASEFOLD );
+ if( nval == NULL ) {
*matchp = 1;
return LDAP_SUCCESS;
}
- strip8bitChars( val );
+ strip8bitChars( nval );
/* Yes, this is necessary */
assertv = UTF8normalize( ((struct berval *)assertedValue)->bv_val,
UTF8_NOCASEFOLD );
if( assertv == NULL ) {
- free( val );
+ ch_free( nval );
*matchp = 1;
return LDAP_SUCCESS;
}
avlen = strlen( assertv );
/* Isolate how many words there are */
- for( c=val,count=1; *c; c++ ) {
+ for( c=nval,count=1; *c; c++ ) {
c = strpbrk( c, SLAPD_APPROX_DELIMITER );
if ( c == NULL ) break;
*c = '\0';
/* Get a phonetic copy of each word */
words = (char **)ch_malloc( count * sizeof(char *) );
values = (char **)ch_malloc( count * sizeof(char *) );
- for( c=val,i=0; i<count; i++,c+=strlen(c)+1 ) {
+ for( c=nval,i=0; i<count; i++,c+=strlen(c)+1 ) {
words[i] = c;
values[i] = phonetic(c);
}
break;
}
}
+ ch_free( val );
}
/* This chunk in the asserted value was NOT within the *value. */
}
ch_free( values );
ch_free( words );
- free( val );
+ ch_free( nval );
return LDAP_SUCCESS;
}
if( idx >= left.bv_len ) {
/* this shouldn't happen */
+ free( nav );
+ ch_free( sub->sa_final );
+ ber_bvecfree( sub->sa_any );
+ ch_free( sub->sa_initial );
+ ch_free( sub );
return LDAP_OTHER;
}
done:
free( nav );
if( sub != NULL ) {
- ch_free( sub->sa_final );
+ ber_bvfree( sub->sa_final );
ber_bvecfree( sub->sa_any );
- ch_free( sub->sa_initial );
+ ber_bvfree( sub->sa_initial );
ch_free( sub );
}
*matchp = match;
if( nkeys == 0 ) {
/* no keys to generate */
*keysp = NULL;
+ ber_bvecfree( nvalues );
return LDAP_SUCCESS;
}
}
if( nkeys == 0 ) {
+ ber_bvfree( sa->sa_final );
+ ber_bvecfree( sa->sa_any );
+ ber_bvfree( sa->sa_initial );
+ ch_free( sa );
*keysp = NULL;
return LDAP_SUCCESS;
}
ch_free( keys );
*keysp = NULL;
}
- ch_free( sa->sa_final );
+ ber_bvfree( sa->sa_final );
ber_bvecfree( sa->sa_any );
- ch_free( sa->sa_initial );
+ ber_bvfree( sa->sa_initial );
ch_free( sa );
return LDAP_SUCCESS;
* Way too large, we need to leave
* room for sign if negative
*/
- return NULL;
+ free(copy);
+ return NULL;
}
*--p = digit[carry];
if (copy[base] == 0)
{"( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' )",
0, IA5StringValidate, IA5StringNormalize, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' )",
- 0, integerValidate, integerNormalize, integerPretty},
+ 0, integerValidate, integerNormalize, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' " X_NOT_H_R ")",
SLAP_SYNTAX_BLOB, blobValidate, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.29 DESC 'Master And Shadow Access Points' )",
{"( 1.3.6.1.4.1.1466.115.121.1.51 DESC 'Teletex Terminal Identifier' )",
0, NULL, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' )",
- 0, printableStringValidate, IA5StringNormalize, NULL},
+ 0, printablesStringValidate, IA5StringNormalize, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.53 DESC 'UTC Time' )",
0, utcTimeValidate, utcTimeNormalize, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.54 DESC 'LDAP Syntax Description' )",
schema_init_done = 1;
return LDAP_SUCCESS;
}
+
+void
+schema_destroy( void )
+{
+ oc_destroy();
+ at_destroy();
+ mr_destroy();
+ syn_destroy();
+}