From 3725c0634b43459580a252769355874bb350afaa Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Thu, 10 Feb 2011 14:24:19 -0500
Subject: [PATCH 1/2] Clear up -Wunused-but-set-variable warnings

---
 src/db/sysdb.c             |    3 +++
 src/ldb_modules/memberof.c |    7 -------
 src/tests/stress-tests.c   |    2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index b7624af78b04bc4479a4d0b9806fe587875d006e..1409149ccfad14d7f7d9471bd8aeaa63c766fff4 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -388,6 +388,9 @@ int sysdb_attrs_steal_string(struct sysdb_attrs *attrs,
     int ret;
 
     ret = sysdb_attrs_get_el(attrs, name, &el);
+    if (ret != EOK) {
+        return ret;
+    }
 
     vals = talloc_realloc(attrs->a, el->values,
                           struct ldb_val, el->num_values+1);
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
index 372aa544f31f40698c96619ce37e01df7cb7929f..311e7e516dbdc08bface332496200b9025cba022 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -1727,16 +1727,9 @@ static int mbof_del_exop_search_callback(struct ldb_request *req,
 static int mbof_del_execute_cont(struct mbof_del_operation *delop)
 {
     struct mbof_del_ancestors_ctx *anc_ctx;
-    struct mbof_del_operation *parent;
-    struct mbof_del_ctx *del_ctx;
-    struct mbof_ctx *ctx;
     struct mbof_dn_array *new_list;
     int i;
 
-    del_ctx = delop->del_ctx;
-    parent = delop->parent;
-    ctx = del_ctx->ctx;
-
     anc_ctx = talloc_zero(delop, struct mbof_del_ancestors_ctx);
     if (!anc_ctx) {
         return LDB_ERR_OPERATIONS_ERROR;
diff --git a/src/tests/stress-tests.c b/src/tests/stress-tests.c
index 5075348e1465a357c88a8853401832193a5306a3..e34f910ad25f94b58b3daff66e512414f8280ee6 100644
--- a/src/tests/stress-tests.c
+++ b/src/tests/stress-tests.c
@@ -59,7 +59,7 @@ int test_lookup_user(const char *name, int enoent_fail)
     pwd = getpwnam(name);
     error = errno;
     if (pwd == NULL) {
-        if (errno == 0 || errno == ENOENT) {
+        if (error == 0 || error == ENOENT) {
             ret = (enoent_fail == 1) ? ENOENT : 0;
         }
     }
-- 
1.7.4

