andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From a2e116442a4a203cdafab3b1f1e1ceea7f9ccb37 Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Fri, 9 May 2014 10:24:27 -0400
dc8c34
Subject: [PATCH 207/225] Ticket 47772 - fix coverity issue
dc8c34
dc8c34
12565 - resource leak
dc8c34
12564 - Explicit null dereferenced
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47772
dc8c34
dc8c34
Reviewed by: rmeggins(Thanks!)
dc8c34
dc8c34
(cherry picked from commit 24d44ba65398470fc8056b14b77b34b5d660f34e)
dc8c34
(cherry picked from commit ad5314fe74344005770356aebe479016395774cf)
dc8c34
---
dc8c34
 ldap/servers/plugins/replication/repl5_protocol_util.c | 5 +++--
dc8c34
 ldap/servers/slapd/modify.c                            | 2 +-
dc8c34
 2 files changed, 4 insertions(+), 3 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c
dc8c34
index 2fbe7c4..827ed58 100644
dc8c34
--- a/ldap/servers/plugins/replication/repl5_protocol_util.c
dc8c34
+++ b/ldap/servers/plugins/replication/repl5_protocol_util.c
dc8c34
@@ -689,16 +689,17 @@ protocol_response2string (int response)
dc8c34
 int
dc8c34
 repl5_strip_fractional_mods(Repl_Agmt *agmt, LDAPMod ** mods)
dc8c34
 {
dc8c34
-	char **a = agmt_get_fractional_attrs(agmt);
dc8c34
+	char **a;
dc8c34
 	char **attrs_to_strip;
dc8c34
 	int retval = 0;
dc8c34
 	int strip = 1;
dc8c34
 	int i, j, k;
dc8c34
 
dc8c34
 	if (mods == NULL) {
dc8c34
-                return retval;
dc8c34
+		return retval;
dc8c34
 	}
dc8c34
 
dc8c34
+	a = agmt_get_fractional_attrs(agmt);
dc8c34
 	if (a) {
dc8c34
 		/* Iterate through the fractional attr list */
dc8c34
 		for ( i = 0; a[i] != NULL; i++ ) 
dc8c34
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
dc8c34
index ab81434..817f17c 100644
dc8c34
--- a/ldap/servers/slapd/modify.c
dc8c34
+++ b/ldap/servers/slapd/modify.c
dc8c34
@@ -402,8 +402,8 @@ do_modify( Slapi_PBlock *pb )
dc8c34
 					 "mod includes invalid dn format", 0, NULL);
dc8c34
 			goto free_and_return;
dc8c34
 		}
dc8c34
+		slapi_pblock_set(pb, SLAPI_MODIFY_MODS, normalized_mods);
dc8c34
 	}
dc8c34
-	slapi_pblock_set(pb, SLAPI_MODIFY_MODS, normalized_mods);
dc8c34
 
dc8c34
 	op_shared_modify ( pb, pw_change, old_pw );
dc8c34
 
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34