Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   config: fix return checks in ldap loader (http://www.linux-archive.org/cluster-development/591082-config-fix-return-checks-ldap-loader.html)

"Fabio M. Di Nitto" 10-25-2011 12:09 PM

config: fix return checks in ldap loader
 
Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
:100644 100644 fb25af4... 49c30b7... M config/plugins/ldap/configldap.c
config/plugins/ldap/configldap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/config/plugins/ldap/configldap.c b/config/plugins/ldap/configldap.c
index fb25af4..49c30b7 100644
--- a/config/plugins/ldap/configldap.c
+++ b/config/plugins/ldap/configldap.c
@@ -216,6 +216,8 @@ static int read_config_for(LDAP *ld, struct objdb_iface_ver0 *objdb, hdb_handle_
struct berval **val_ber;

val_ber = ldap_get_values_len(ld, e, attr);
+ if (!val_ber)
+ goto ldap_next;
i=0;
while (val_ber[i]) {
/*
@@ -244,9 +246,10 @@ static int read_config_for(LDAP *ld, struct objdb_iface_ver0 *objdb, hdb_handle_
}
i++;
}
+ ldap_value_free_len(val_ber);
+ldap_next:
ldap_memfree(attr);
attr = ldap_next_attribute(ld, e, attr_ber);
- ldap_value_free_len(val_ber);
}
ldap_memfree(attr);
ber_free(attr_ber, 0);
--
1.7.4.4


All times are GMT. The time now is 10:09 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.