URL: https://github.com/SSSD/sssd/pull/686
Author: pbrezina
 Title: #686: nss: use enumeration context as talloc parent for cache req result
Action: opened

PR body:
"""
Otherwise we end up with memory leak since the result is never freed.

Resolves:
https://pagure.io/SSSD/sssd/issue/3870
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/686/head:pr686
git checkout pr686
From 723952ec4eba477f57de56957b989e1239477a83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrez...@redhat.com>
Date: Tue, 30 Oct 2018 13:21:28 +0100
Subject: [PATCH] nss: use enumeration context as talloc parent for cache req
 result

Otherwise we end up with memory leak since the result is never freed.

Resolves:
https://pagure.io/SSSD/sssd/issue/3870
---
 src/responder/nss/nss_enum.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/responder/nss/nss_enum.c b/src/responder/nss/nss_enum.c
index a45b65233..9588943c9 100644
--- a/src/responder/nss/nss_enum.c
+++ b/src/responder/nss/nss_enum.c
@@ -138,7 +138,7 @@ static void nss_setent_internal_done(struct tevent_req *subreq)
     switch (ret) {
     case EOK:
         talloc_zfree(state->enum_ctx->result);
-        state->enum_ctx->result = talloc_steal(state->nss_ctx, result);
+        state->enum_ctx->result = talloc_steal(state->enum_ctx, result);
 
         if (state->type == CACHE_REQ_NETGROUP_BY_NAME) {
             /* We need to expand the netgroup into triples and members. */
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to