summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2016-07-08 12:16:47 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2016-07-11 12:03:13 +0200
commit4b18d0c25471150940c1a552bc2504ff9debb703 (patch)
treeea1bb9a2904b1f433f4f854881eb05ff79220643
parent311836214245600566f881ff6253594e0999008e (diff)
downloadsssd-4b18d0c25471150940c1a552bc2504ff9debb703.zip
sssd-4b18d0c25471150940c1a552bc2504ff9debb703.tar.gz
sssd-4b18d0c25471150940c1a552bc2504ff9debb703.tar.xz
sssctl: Fix error handling after memory allocation failure
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--src/tools/sssctl/sssctl_cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/sssctl/sssctl_cache.c b/src/tools/sssctl/sssctl_cache.c
index 9f626d9..28de6c1 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;
}