Hi,

I'm sorry I didn't catch this when I developed the original patch, but
today I was trying to write the leak patches as Lukas suggested the
other day..I haven't succeeded at that yet, but I found another leak.

A patch is attached.
>From 624095b4f8151c51c1383b724a9afb30149a2cae Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Wed, 6 Apr 2016 18:35:39 +0200
Subject: [PATCH] memberof: Fix a memory leak when removing ghost users

---
 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 
54e4b3ee2c74b746e8871cb3bb211bfcb25752e0..0d909bfe811078861f0f0c8cc54c76752397f1c9
 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -2531,7 +2531,7 @@ static int mbof_del_fill_ghop_ex(struct mbof_del_ctx 
*del_ctx,
               num_gh_vals, mbof->num_values);
 
     for (i = 0; i < mbof->num_values; i++) {
-        valdn = ldb_dn_from_ldb_val(del_ctx->ghops,
+        valdn = ldb_dn_from_ldb_val(del_ctx,
                                     ldb_module_get_ctx(del_ctx->ctx->module),
                                     &mbof->values[i]);
         if (!valdn || !ldb_dn_validate(valdn)) {
@@ -2556,6 +2556,7 @@ static int mbof_del_fill_ghop_ex(struct mbof_del_ctx 
*del_ctx,
             if (ret != LDB_SUCCESS) {
                 return ret;
             }
+            talloc_steal(del_ctx->ghops, valdn);
         }
     }
 
-- 
2.4.11

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to