From: Ding Fei Date: Fri, 4 Dec 2020 03:11:04 +0000 (+0800) Subject: ITS #9417 ldapexop exit with correct rc value X-Git-Tag: OPENLDAP_REL_ENG_2_4_57~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e738d7506c2f4b2e5f6adaf8ca95a63468054d5;p=thirdparty%2Fopenldap.git ITS #9417 ldapexop exit with correct rc value `rc` collects exit status all the way down but is not used at all? If `code` comparison at exit is intended then there exists some path that leaves it in garbage value, say when `ldap_whoami` or `ldap_cancel` fails. --- diff --git a/clients/tools/ldapexop.c b/clients/tools/ldapexop.c index f4ecf04d04..27ba39669e 100644 --- a/clients/tools/ldapexop.c +++ b/clients/tools/ldapexop.c @@ -351,5 +351,5 @@ skip: /* disconnect from server */ if ( res ) ldap_msgfree( res ); - tool_exit( ld, code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE ); + tool_exit( ld, rc ); }