andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 7993502b5e00c7f2d05d1b0c3feb573cf62e1a49 Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@redhat.com>
Date: Mon, 9 Dec 2013 17:00:32 -0700
Subject: [PATCH 113/115] Ticket #47623 fix memleak caused by 47347

https://fedorahosted.org/389/ticket/47623
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.2.11
Fix Description: Only need to create the mutex when creating a new PR object.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 98ccb602058270e97a3702ae2b81c17635af8d27)
(cherry picked from commit 65c51555c0ecc94c5d93f09124168697ba1db6b3)
(cherry picked from commit 8a2c666df491b7c8666f8a70a5038b35c43fbc3b)
(cherry picked from commit 8968e078caacf1021a11c19546c448a4b65db098)
(cherry picked from commit 1ad3604b8bfbd5c2a3c4ca8f55b8690a2098f3df)
---
 ldap/servers/slapd/pagedresults.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c
index 78bd6b0..a835d6b 100644
--- a/ldap/servers/slapd/pagedresults.c
+++ b/ldap/servers/slapd/pagedresults.c
@@ -122,6 +122,7 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
                            sizeof(PagedResults) * maxlen);
             }
             *index = maxlen; /* the first position in the new area */
+            conn->c_pagedresults.prl_list[*index].pr_mutex = PR_NewLock();
         } else {
             for (i = 0; i < conn->c_pagedresults.prl_maxlen; i++) {
                 if (!conn->c_pagedresults.prl_list[i].pr_current_be) {
@@ -131,7 +132,6 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
             }
         }
         conn->c_pagedresults.prl_count++;
-        conn->c_pagedresults.prl_list[*index].pr_mutex = PR_NewLock();
     } else {
         /* Repeated paged results request.
          * PagedResults is already allocated. */
-- 
1.8.1.4