mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
plug leaks
This commit is contained in:
parent
0b72c15e52
commit
8c4711e9db
@ -1024,7 +1024,7 @@ int ldap_pvt_sasl_secprops(
|
||||
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;
|
||||
@ -1034,7 +1034,11 @@ int ldap_pvt_sasl_secprops(
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1414,16 +1414,20 @@ add_extension(LDAPSchemaExtensionItem ***extensions,
|
||||
if ( !*extensions ) {
|
||||
*extensions =
|
||||
LDAP_CALLOC(2, sizeof(LDAPSchemaExtensionItem *));
|
||||
if ( !*extensions )
|
||||
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;
|
||||
|
@ -205,6 +205,10 @@ get_modlist(
|
||||
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 {
|
||||
|
@ -1309,12 +1309,18 @@ ldap_url_parsehosts(
|
||||
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 {
|
||||
@ -1328,6 +1334,8 @@ ldap_url_parsehosts(
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user