ldap/servers/plugins/mep/mep.c | 15 +++++++++++----
ldap/servers/plugins/replication/repl5_protocol_util.c | 6 ++----
ldap/servers/plugins/replication/windows_protocol_util.c | 2 ++
ldap/servers/slapd/back-ldbm/import-threads.c | 4 ++++
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 5 +++++
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 1 +
ldap/servers/slapd/tools/mmldif.c | 3 ++-
7 files changed, 27 insertions(+), 9 deletions(-)
New commits:
commit 2af08b37e8bcebb68ad85c8cc6195f8f6d3403f1
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Thu Sep 16 14:35:12 2010 -0400
Bug 630092 - Coverity #15497: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The moddn_rename_children() has been modified to release
child_entry_copies before it returns.
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index c8b4903..e62a8b5 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -1598,6 +1598,7 @@ moddn_rename_children(
}
}
slapi_ldap_value_free( newsuperiordns );
+ slapi_ch_free((void**)&child_entry_copies);
return retval;
}
commit f88490faa19daaf0e43ed27a7f936ea5cca4cda0
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Thu Sep 16 14:29:30 2010 -0400
Bug 630092 - Coverity #15490: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The import_producer() has been modified to release ep when an error
occured.
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c
b/ldap/servers/slapd/back-ldbm/import-threads.c
index b18bbce..c00e4b7 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -636,6 +636,7 @@ import_producer(void *param)
ep = import_make_backentry(e, id);
if ((ep == NULL) || (ep->ep_entry == NULL)) {
slapi_entry_free(e);
+ backentry_free(&ep);
goto error;
}
commit 1aab7c095a094f81916b7061a447570fde17407a
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Thu Sep 16 14:25:00 2010 -0400
Bug 630092 - Coverity #15487: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The index_set_entry_to_fifo() has been modified to release ep when
the job is aborted.
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c
b/ldap/servers/slapd/back-ldbm/import-threads.c
index 9629a9e..b18bbce 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -805,6 +805,7 @@ index_set_entry_to_fifo(ImportWorkerInfo *info, Slapi_Entry *e,
}
if (job->flags & FLAG_ABORT) {
+ backentry_free(&ep);
goto bail;
}
@@ -831,6 +832,7 @@ index_set_entry_to_fifo(ImportWorkerInfo *info, Slapi_Entry *e,
DS_Sleep(sleeptime);
}
if (job->flags & FLAG_ABORT) {
+ backentry_free(&ep);
goto bail;
}
commit 889b6d03b0e6ef0b315f78437dc7217e23ae63d0
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Thu Sep 16 14:18:05 2010 -0400
Bug 630092 - Coverity #15485: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The _entryrdn_delete_key() has been modified to release tmpsrdn
when an error occurs.
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
index 503d96b..4fbae15 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
@@ -2363,6 +2363,7 @@ retry_get0:
"_entryrdn_delete_key: Failed to generate a parent "
"elem: dn: %s\n", dn);
slapi_ch_free_string(&dn);
+ slapi_rdn_free(&tmpsrdn);
goto bail;
}
} else if (parentnrdn) {
commit ba741cade5aef1cbb8ede386b7f2b85d57745d75
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Thu Sep 16 12:38:32 2010 -0400
Bug 630092 - Coverity #15484: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The bulk_import_queue() has been modified to release ep when an
error occurs.
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c
b/ldap/servers/slapd/back-ldbm/import-threads.c
index 171be08..9629a9e 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -2736,6 +2736,7 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry)
ep = import_make_backentry(entry, id);
if ((ep == NULL) || (ep->ep_entry == NULL)) {
import_abort_all(job, 1);
+ backentry_free( &ep ); /* release the backend wrapper, here */
PR_Unlock(job->wire_lock);
return -1;
}
commit 4078b6113628c0a842a6caf7c54535ca95cacfd7
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Thu Sep 16 11:56:49 2010 -0400
Bug 630092 - Coverity #15483: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The _entryrdn_index_read() has been modified to release tmpsrdn
when an error occurs.
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
index f3474fa..503d96b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
@@ -2560,6 +2560,7 @@ _entryrdn_index_read(backend *be,
"_entryrdn_index_read: Failed to generate a new elem:
"
"dn: %s\n", dn);
slapi_ch_free_string(&dn);
+ slapi_rdn_free(&tmpsrdn);
goto bail;
}
slapi_rdn_free(&tmpsrdn);
@@ -2627,6 +2628,9 @@ _entryrdn_index_read(backend *be,
"_entryrdn_index_read: Failed to generate a new elem:
"
"dn: %s\n", dn);
slapi_ch_free_string(&dn);
+ if (tmpsrdn != srdn) {
+ slapi_rdn_free(&tmpsrdn);
+ }
goto bail;
}
if (tmpsrdn != srdn) {
commit 753ee0945a968c849e37cc42971dc5a75bc4f0a8
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Tue Sep 14 23:33:13 2010 -0400
Bug 630092 - Coverity #15482: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The windows_search_local_entry_by_uniqueid() has been modified to release
the memory allocated for local_subtree.
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c
b/ldap/servers/plugins/replication/windows_protocol_util.c
index ff39fb5..3fe42cf 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -4607,6 +4607,8 @@ windows_search_local_entry_by_uniqueid(Private_Repl_Protocol *prp,
const char *u
{
PR_smprintf_free(filter_string);
}
+
+ if (is_global) slapi_sdn_free(&local_subtree);
return rc;
}
commit 8c524b4700238edba8a307a213ba81cb56a2b913
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Tue Sep 14 22:54:03 2010 -0400
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.
diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c
b/ldap/servers/plugins/replication/repl5_protocol_util.c
index 02b16b5..16032b2 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)
commit 2a267dc9c52ff4f641a6045e6c481ea881010975
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Tue Sep 14 21:06:13 2010 -0400
Bug 630092 - Coverity #15479: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The mep_pre_op() is correctly allocating and releasing smods during
modify operation. However, the "else" clause on line 1517 theoretically
allows other operations to enter and cause resource leak. The code has
been modified to reject other operations from operating against the
config entries.
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
index 72af428..cb329e4 100644
--- a/ldap/servers/plugins/mep/mep.c
+++ b/ldap/servers/plugins/mep/mep.c
@@ -1514,7 +1514,8 @@ mep_pre_op(Slapi_PBlock * pb, int modop)
if (LDAP_CHANGETYPE_ADD == modop) {
slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &e);
- } else {
+
+ } else if (LDAP_CHANGETYPE_MODIFY == modop) {
/* Fetch the entry being modified so we can
* create the resulting entry for validation. */
Slapi_DN *tmp_dn = slapi_sdn_new_dn_byref(dn);
@@ -1541,6 +1542,12 @@ mep_pre_op(Slapi_PBlock * pb, int modop)
* to let the main server handle it. */
goto bailmod;
}
+
+ } else {
+ /* Refuse other operations. */
+ ret = LDAP_UNWILLING_TO_PERFORM;
+ errstr = slapi_ch_smprintf("Not a valid operation.");
+ goto bail;
}
if (mep_parse_config_entry(e, 0) != 0) {
commit 019789548c33ec6155a0cbebfe81c58bac4d1ed8
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Tue Sep 14 20:36:37 2010 -0400
Bug 630092 - Coverity #15478: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The mep_pre_op() has been modified to release config_copy before it goes
out of scope by moving mep_free_config_entry() out of the switch statement.
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
index c0ce013..72af428 100644
--- a/ldap/servers/plugins/mep/mep.c
+++ b/ldap/servers/plugins/mep/mep.c
@@ -1631,11 +1631,11 @@ mep_pre_op(Slapi_PBlock * pb, int modop)
/* Dispose of the test entry */
slapi_entry_free(test_entry);
-
- /* Free the config copy */
- mep_free_config_entry(&config_copy);
break;
}
+
+ /* Free the config copy */
+ mep_free_config_entry(&config_copy);
}
mep_config_unlock();
commit bef946f15f1e7f5694e8e044df3444d78b558d4f
Author: Endi Sukma Dewata <edewata(a)redhat.com>
Date: Tue Sep 14 20:25:53 2010 -0400
Bug 630092 - Coverity #12117: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The putvalue() has been modified to release b64 using freeEnc64()
before it returns.
diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c
index b364a19..6d62338 100644
--- a/ldap/servers/slapd/tools/mmldif.c
+++ b/ldap/servers/slapd/tools/mmldif.c
@@ -1245,7 +1245,7 @@ putvalue(
int valuelen
)
{
- Enc64_t * b64;
+ Enc64_t * b64 = NULL;
char * lptr;
char line[255];
int return_code;
@@ -1330,6 +1330,7 @@ putvalue(
}
return_bit:
+ if (b64) freeEnc64(b64);
if (tag != NULL) {
fputs("-\n", fh);
}