From 8c524b4700238edba8a307a213ba81cb56a2b913 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Tue, 14 Sep 2010 22:54:03 -0400 Subject: Bug 630092 - Coverity #15481: Resource leaks issues https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The acquire_replica() has been modified to release current_csn before it returns. --- ldap/servers/plugins/replication/repl5_protocol_util.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c index 02b16b50..16032b27 100644 --- a/ldap/servers/plugins/replication/repl5_protocol_util.c +++ b/ldap/servers/plugins/replication/repl5_protocol_util.c @@ -121,6 +121,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) char *retoid = NULL; Slapi_DN *replarea_sdn = NULL; struct berval **ruv_bervals = NULL; + CSN *current_csn = NULL; PR_ASSERT(prp && prot_oid); @@ -176,8 +177,6 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } else { - CSN *current_csn = NULL; - /* we don't want the timer to go off in the middle of an operation */ conn_cancel_linger(conn); @@ -276,8 +275,6 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } /* JCMREPL - Need to extract the referrals from the RUV */ - csn_free(¤t_csn); - current_csn = NULL; crc = conn_send_extended_operation(conn, prp->repl90consumer ? REPL_START_NSDS90_REPLICATION_REQUEST_OID : REPL_START_NSDS50_REPLICATION_REQUEST_OID, payload, @@ -522,6 +519,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } error: + csn_free(¤t_csn); if (NULL != ruv_bervals) ber_bvecfree(ruv_bervals); if (NULL != replarea_sdn) -- cgit