dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From 58e3bfad6a6fc5d44c928b37e79bc36775aee2a8 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Fri, 8 Apr 2016 11:47:44 +0200
Subject: [PATCH 111/111] memberof: Don't allocate on NULL when deleting
 memberUids
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 27a0be2bb6f21f66527e0edea4ed2cb4b5cafa53)
---
 src/ldb_modules/memberof.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
index 118e95a4d3b6246f2c7775f300ac345ac63ff17a..6c0180a493ce0c013b5882100a85b453e4111e63 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -2471,7 +2471,7 @@ static int mbof_del_fill_muop(struct mbof_del_ctx *del_ctx,
     for (i = 0; i < el->num_values; i++) {
         struct ldb_dn *valdn;
 
-        valdn = ldb_dn_from_ldb_val(del_ctx->muops,
+        valdn = ldb_dn_from_ldb_val(del_ctx,
                                     ldb_module_get_ctx(del_ctx->ctx->module),
                                     &el->values[i]);
         if (!valdn || !ldb_dn_validate(valdn)) {
@@ -2489,6 +2489,7 @@ static int mbof_del_fill_muop(struct mbof_del_ctx *del_ctx,
         if (ret != LDB_SUCCESS) {
             return ret;
         }
+        talloc_steal(del_ctx->muops, valdn);
     }
 
     return LDB_SUCCESS;
-- 
2.4.11