Blame SOURCES/0051-Ticket-49531-coverity-issues-fix-memory-leaks.patch

058656
From 7acfb18228322ab2e331720bd7fe083da04625a2 Mon Sep 17 00:00:00 2001
058656
From: Mark Reynolds <mreynolds@redhat.com>
058656
Date: Fri, 12 Jan 2018 09:50:34 -0500
058656
Subject: [PATCH] Ticket 49531 - coverity issues - fix memory leaks
058656
058656
Description:  There were two false positives around pwpolicy struct
058656
              being leaked, but it is freed when the pblock is
058656
              destroyed.  The other two leaks were real, but they
058656
              only occurred during error conditions.
058656
058656
https://pagure.io/389-ds-base/issue/49531
058656
058656
Reviewed by: lkrispen (Thanks!)
058656
058656
(cherry picked from commit 700d7422e6309d2d405961abbb805fbfe852e53c)
058656
---
058656
 ldap/servers/plugins/replication/cl5_api.c | 1 +
058656
 ldap/servers/plugins/replication/urp.c     | 3 ++-
058656
 2 files changed, 3 insertions(+), 1 deletion(-)
058656
058656
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
058656
index dc2857910..89ae9956c 100644
058656
--- a/ldap/servers/plugins/replication/cl5_api.c
058656
+++ b/ldap/servers/plugins/replication/cl5_api.c
058656
@@ -4046,6 +4046,7 @@ _cl5WriteRUV(CL5DBFile *file, PRBool purge)
058656
         slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl,
058656
                       "_cl5WriteRUV - changelog maxRUV not found in changelog for file %s\n",
058656
                       file->name);
058656
+        ber_bvecfree(vals);
058656
         return CL5_DB_ERROR;
058656
     }
058656
 
058656
diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c
058656
index 9534c0322..d4556d7fd 100644
058656
--- a/ldap/servers/plugins/replication/urp.c
058656
+++ b/ldap/servers/plugins/replication/urp.c
058656
@@ -861,7 +861,7 @@ urp_fixup_add_cenotaph (Slapi_PBlock *pb, char *sessionid, CSN *opcsn)
058656
     Slapi_Entry *pre_entry = NULL;
058656
     int ret = 0;
058656
     Slapi_DN *pre_sdn = NULL;
058656
-    Slapi_RDN *rdn = slapi_rdn_new();
058656
+    Slapi_RDN *rdn = NULL;
058656
     char *parentdn = NULL;
058656
     char *newdn;
058656
     const char *entrydn;
058656
@@ -882,6 +882,7 @@ urp_fixup_add_cenotaph (Slapi_PBlock *pb, char *sessionid, CSN *opcsn)
058656
        entrydn = slapi_entry_get_ndn (pre_entry);*/
058656
     uniqueid = slapi_entry_get_uniqueid (pre_entry);
058656
     parentdn = slapi_dn_parent(entrydn);
058656
+    rdn = slapi_rdn_new();
058656
     slapi_sdn_get_rdn(pre_sdn, rdn);
058656
     slapi_rdn_remove_attr (rdn, SLAPI_ATTR_UNIQUEID );
058656
     slapi_rdn_add(rdn, "cenotaphID", uniqueid);
058656
-- 
058656
2.13.6
058656