summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2010-09-14 22:54:03 -0400
committerNathan Kinder <nkinder@redhat.com>2010-09-17 12:14:17 -0700
commit8c524b4700238edba8a307a213ba81cb56a2b913 (patch)
tree8bae10b5eabdd515d6d7978d8b329e7b835b5ca9
parent2a267dc9c52ff4f641a6045e6c481ea881010975 (diff)
downloadds-8c524b4700238edba8a307a213ba81cb56a2b913.tar.gz
ds-8c524b4700238edba8a307a213ba81cb56a2b913.tar.xz
ds-8c524b4700238edba8a307a213ba81cb56a2b913.zip
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.
-rw-r--r--ldap/servers/plugins/replication/repl5_protocol_util.c6
1 files 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(&current_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(&current_csn);
if (NULL != ruv_bervals)
ber_bvecfree(ruv_bervals);
if (NULL != replarea_sdn)