mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
don't leak in case of error
This commit is contained in:
parent
27003dccd5
commit
60b03d4103
1 changed files with 19 additions and 2 deletions
|
|
@ -195,6 +195,7 @@ meta_back_db_config(
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( c = 0; uris[ c ] != NULL; c++ ) {
|
for ( c = 0; uris[ c ] != NULL; c++ ) {
|
||||||
|
char *tmpuri = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* uri MUST be legal!
|
* uri MUST be legal!
|
||||||
|
|
@ -207,6 +208,7 @@ meta_back_db_config(
|
||||||
"%s: line %d: unable to parse URI #%d"
|
"%s: line %d: unable to parse URI #%d"
|
||||||
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
|
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
|
||||||
fname, lineno, c );
|
fname, lineno, c );
|
||||||
|
ldap_charray_free( uris );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -220,6 +222,8 @@ meta_back_db_config(
|
||||||
"%s: line %d: missing <naming context> "
|
"%s: line %d: missing <naming context> "
|
||||||
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
|
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
|
||||||
fname, lineno, 0 );
|
fname, lineno, 0 );
|
||||||
|
ldap_free_urllist( ludp );
|
||||||
|
ldap_charray_free( uris );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -233,6 +237,8 @@ meta_back_db_config(
|
||||||
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
|
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
|
||||||
"target \"%s\" DN is invalid\n",
|
"target \"%s\" DN is invalid\n",
|
||||||
fname, lineno, argv[ 1 ] );
|
fname, lineno, argv[ 1 ] );
|
||||||
|
ldap_free_urllist( ludp );
|
||||||
|
ldap_charray_free( uris );
|
||||||
return( 1 );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -252,6 +258,8 @@ meta_back_db_config(
|
||||||
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
|
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
|
||||||
"invalid scope for target \"%s\"\n",
|
"invalid scope for target \"%s\"\n",
|
||||||
fname, lineno, argv[ 1 ] );
|
fname, lineno, argv[ 1 ] );
|
||||||
|
ldap_free_urllist( ludp );
|
||||||
|
ldap_charray_free( uris );
|
||||||
return( 1 );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -262,14 +270,23 @@ meta_back_db_config(
|
||||||
"multiple URIs must have "
|
"multiple URIs must have "
|
||||||
"no DN part\n",
|
"no DN part\n",
|
||||||
fname, lineno, 0 );
|
fname, lineno, 0 );
|
||||||
|
ldap_free_urllist( ludp );
|
||||||
|
ldap_charray_free( uris );
|
||||||
return( 1 );
|
return( 1 );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ldap_memfree( uris[ c ] );
|
tmpuri = ldap_url_list2urls( ludp );
|
||||||
uris[ c ] = ldap_url_list2urls( ludp );
|
|
||||||
ldap_free_urllist( ludp );
|
ldap_free_urllist( ludp );
|
||||||
|
if ( tmpuri == NULL ) {
|
||||||
|
Debug( LDAP_DEBUG_ANY, "%s: line %d: no memory?\n",
|
||||||
|
fname, lineno, 0 );
|
||||||
|
ldap_charray_free( uris );
|
||||||
|
return( 1 );
|
||||||
|
}
|
||||||
|
ldap_memfree( uris[ c ] );
|
||||||
|
uris[ c ] = tmpuri;
|
||||||
}
|
}
|
||||||
|
|
||||||
mt->mt_uri = ldap_charray2str( uris, " " );
|
mt->mt_uri = ldap_charray2str( uris, " " );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue