From 628e96ce1fce194b30a5c2912feb8b7ec0328db0 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 4 Nov 2018 17:06:47 +0300 Subject: tdf#120703 PVS: V547 Expression is always true/false Change-Id: I3432afca1ee9bf9e8adce1d55d58d57bf1a09cb4 Reviewed-on: https://gerrit.libreoffice.org/62847 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- extensions/source/config/ldap/ldapaccess.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'extensions/source/config/ldap') diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index caece9d1cde5..e6a44aa1b0c1 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -73,11 +73,10 @@ static void checkLdapReturnCode(const sal_Char *aOperation, message += OUString::createFromAscii(aOperation) + ": "; } message += OUString::createFromAscii(ldap_err2string(aRetCode)) + " (" ; - sal_Char *stub = nullptr ; #ifndef LDAP_OPT_SIZELIMIT // for use with OpenLDAP + sal_Char* stub = nullptr; ldap_get_lderrno(aConnection, NULL, &stub) ; -#endif if (stub != nullptr) { message += OUString::createFromAscii(stub) ; @@ -88,7 +87,10 @@ static void checkLdapReturnCode(const sal_Char *aOperation, // This call is thus disabled for the moment. //ldap_memfree(stub) ; } - else { message += "No additional information" ; } + else +#endif + { message += "No additional information"; } + message += ")" ; throw ldap::LdapGenericException(message, nullptr, aRetCode) ; } -- cgit