From: Howard Chu Date: Fri, 10 Apr 2026 16:46:03 +0000 (+0100) Subject: ITS#8905 clients: fixup connect fail message X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fopenldap.git ITS#8905 clients: fixup connect fail message --- diff --git a/clients/tools/common.c b/clients/tools/common.c index d0dc2a48f1..4b913dd306 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -1415,9 +1415,14 @@ dnssrv_free:; rc = ldap_connect( ld ); if( rc != LDAP_SUCCESS ) { - fprintf( stderr, - "Could not connect to URI=%s ", ldapuri ); - tool_perror2( ld, "" ); + static const char connectErr[] = "Could not connect to URI"; + char *msg = malloc( strlen( ldapuri ) + sizeof(connectErr) + 2 ); + if ( msg ) + sprintf(msg, "%s=%s", connectErr, ldapuri ); + else + msg = connectErr; + tool_perror2( ld, msg ); + if ( msg != connectErr ) free( msg ); tool_exit( ld, EXIT_FAILURE ); }