Blob Blame History Raw
From 36adb8fdc1e0ec14d394a2c51be16c90f4fa1acd Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Fri, 8 Jul 2016 12:16:47 +0200
Subject: [PATCH 02/18] sssctl: Fix error handling after memory allocation
 failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
(cherry picked from commit 4b18d0c25471150940c1a552bc2504ff9debb703)
---
 src/tools/sssctl/sssctl_cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tools/sssctl/sssctl_cache.c b/src/tools/sssctl/sssctl_cache.c
index 9f626d983a4672cf00fba6b3171b822e8f6e02bd..28de6c139d844f98f9b06844492c935696e19643 100644
--- a/src/tools/sssctl/sssctl_cache.c
+++ b/src/tools/sssctl/sssctl_cache.c
@@ -364,8 +364,9 @@ static errno_t sssctl_find_object(TALLOC_CTX *mem_ctx,
         filter = talloc_asprintf(tmp_ctx, "(&(objectClass=%s)(%s=%s))",
                                  class, attr_name, filter_value);
         talloc_free(filter_value);
-        if (filter_value == NULL) {
+        if (filter == NULL) {
             DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf() failed\n");
+            ret = ENOMEM;
             goto done;
         }
 
-- 
2.4.11