[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication repl5_protocol_util.c, 1.8, 1.8.2.1

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Wed Jan 9 18:59:57 UTC 2008


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31454

Modified Files:
      Tag: Directory71RtmBranch
	repl5_protocol_util.c 
Log Message:
Resolves: 196523
Summary: miscellaneous memory leaks
Description: applying the patch to Directory71RtmBranch



Index: repl5_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- repl5_protocol_util.c	18 May 2005 03:17:33 -0000	1.8
+++ repl5_protocol_util.c	9 Jan 2008 18:59:55 -0000	1.8.2.1
@@ -112,6 +112,10 @@
 	int return_value;
 	ConnResult crc;
 	Repl_Connection *conn;
+	struct berval *retdata = NULL;
+	char *retoid = NULL;
+	Slapi_DN *replarea_sdn = NULL;
+	struct berval **ruv_bervals = NULL;
 
 	PR_ASSERT(prp && prot_oid);
 
@@ -195,9 +199,6 @@
 			} else 
 			{
 				CSN *current_csn = NULL;
-				struct berval *retdata = NULL;
-				char *retoid = NULL;
-				Slapi_DN *replarea_sdn;
 
 				/* Good to go. Start the protocol. */
 
@@ -238,7 +239,6 @@
 						 * Extop was processed. Look at extop response to see if we're
 						 * permitted to go ahead.
 						 */
-						struct berval **ruv_bervals = NULL;
 						int extop_result;
 						int extop_rc = decode_repl_ext_response(retdata, &extop_result,
 																&ruv_bervals);
@@ -392,8 +392,6 @@
 							prp->last_acquire_response_code = NSDS50_REPL_INTERNAL_ERROR;
 							return_value = ACQUIRE_FATAL_ERROR;
 						}
-						if (NULL != ruv_bervals)
-							ber_bvecfree(ruv_bervals);
 					}
 					else
 					{
@@ -418,15 +416,18 @@
 						agmt_get_long_name(prp->agmt));
 					return_value = ACQUIRE_FATAL_ERROR;
 				}
-				slapi_sdn_free(&replarea_sdn);
-				if (NULL != retoid)
-					ldap_memfree(retoid);
-				if (NULL != retdata)
-					ber_bvfree(retdata);
 			}
 		}
 	}
 error:
+	if (NULL != ruv_bervals)
+		ber_bvecfree(ruv_bervals);
+	if (NULL != replarea_sdn)
+		slapi_sdn_free(&replarea_sdn);
+	if (NULL != retoid)
+		ldap_memfree(retoid);
+	if (NULL != retdata)
+		ber_bvfree(retdata);
 
 	if (ACQUIRE_SUCCESS != return_value)
 	{




More information about the Fedora-directory-commits mailing list