From 661541fdfc45e7181457f923ee87ea70318b8b97 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 28 Nov 2002 04:36:22 +0000 Subject: [PATCH] Fix error handling --- libraries/libldap/passwd.c | 8 ++++++-- libraries/libldap/whoami.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libraries/libldap/passwd.c b/libraries/libldap/passwd.c index d2d32b58a5..a186abe040 100644 --- a/libraries/libldap/passwd.c +++ b/libraries/libldap/passwd.c @@ -146,6 +146,10 @@ ldap_passwd_s( } rc = ldap_parse_passwd( ld, res, newpasswd ); - ldap_msgfree( res ); - return rc; + if( rc != LDAP_SUCCESS ) { + ldap_msgfree( res ); + return rc; + } + + return( ldap_result2error( ld, res, 1 ) ); } diff --git a/libraries/libldap/whoami.c b/libraries/libldap/whoami.c index 3ad13869c9..23fe395301 100644 --- a/libraries/libldap/whoami.c +++ b/libraries/libldap/whoami.c @@ -80,6 +80,10 @@ ldap_whoami_s( } rc = ldap_parse_whoami( ld, res, authzid ); - ldap_msgfree( res ); - return rc; + if( rc != LDAP_SUCCESS ) { + ldap_msgfree( res ); + return rc; + } + + return( ldap_result2error( ld, res, 1 ) ); } -- 2.39.5