summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-25 16:27:12 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-05-02 08:10:16 -0400
commitdebccfee089ff6e952733f44c891840b74e243ec (patch)
tree5259be72067181ecfe0489804ed86983112b11ae
parent20aee697450e41423ca0e2fc749e659d18f19976 (diff)
downloadsssd-debccfee089ff6e952733f44c891840b74e243ec.tar.gz
sssd-debccfee089ff6e952733f44c891840b74e243ec.tar.xz
sssd-debccfee089ff6e952733f44c891840b74e243ec.zip
SYSDB: check return value
In addition to testing the number of elements, also check the return value of sysdb_attrs_get_el.
-rw-r--r--src/db/sysdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index de23607a5..41c677d7e 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -1613,7 +1613,7 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb,
ret = sysdb_attrs_get_el(attrs,
SYSDB_NAME,
&sysdb_name_el);
- if (sysdb_name_el->num_values == 0) {
+ if (ret != EOK || sysdb_name_el->num_values == 0) {
ret = EINVAL;
goto done;
}
@@ -1730,7 +1730,7 @@ errno_t sysdb_attrs_get_aliases(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_el(attrs,
SYSDB_NAME,
&sysdb_name_el);
- if (sysdb_name_el->num_values == 0) {
+ if (ret != EOK || sysdb_name_el->num_values == 0) {
ret = EINVAL;
goto done;
}