summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2007-04-09 23:02:41 +0000
committerRich Megginson <rmeggins@redhat.com>2007-04-09 23:02:41 +0000
commit89d4bcb473418d6571b4a353de2c0fdae85f266c (patch)
tree5a050e1475bf57874285b4a48efefbff68a9f013
parentacce69047413286cd93933708c3aa0c15ce1763b (diff)
downloadds-89d4bcb473418d6571b4a353de2c0fdae85f266c.tar.gz
ds-89d4bcb473418d6571b4a353de2c0fdae85f266c.tar.xz
ds-89d4bcb473418d6571b4a353de2c0fdae85f266c.zip
Resolves: bug 235743
Bug Description: small memory leaks in task code Reviewed by: nkinder, nhosoi (Thanks!) Fix Description: There were a few places that were using slapi_get_first/next_backend without freeing the iterator cookie. Platforms tested: RHEL4 Flag Day: no Doc impact: no
-rw-r--r--ldap/servers/slapd/backend_manager.c1
-rw-r--r--ldap/servers/slapd/task.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/ldap/servers/slapd/backend_manager.c b/ldap/servers/slapd/backend_manager.c
index b8af0eb6..ca355ca9 100644
--- a/ldap/servers/slapd/backend_manager.c
+++ b/ldap/servers/slapd/backend_manager.c
@@ -496,6 +496,7 @@ slapi_lookup_instance_name_by_suffix(char *suffix,
PR_Unlock(be->be_suffixlock);
be = (backend *)slapi_get_next_backend (cookie);
}
+ slapi_ch_free((void **)&cookie);
return rval;
}
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index 629933b3..f01cf28a 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -1028,6 +1028,7 @@ static int task_backup_add(Slapi_PBlock *pb, Slapi_Entry *e,
be = (backend *)slapi_get_next_backend (cookie);
}
+ slapi_ch_free((void **)&cookie);
if (NULL == be || NULL == be->be_database->plg_db2archive) {
LDAPDebug(LDAP_DEBUG_ANY,
"ERROR: no db2archive function defined.\n", 0, 0, 0);
@@ -1174,6 +1175,7 @@ static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e,
be = (backend *)slapi_get_next_backend (cookie);
}
+ slapi_ch_free((void **)&cookie);
if (NULL == be || NULL == be->be_database->plg_archive2db) {
LDAPDebug(LDAP_DEBUG_ANY,
"ERROR: no db2archive function defined.\n", 0, 0, 0);
@@ -1443,6 +1445,7 @@ task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter,
be = (backend *)slapi_get_next_backend (cookie);
}
+ slapi_ch_free((void **)&cookie);
if (NULL == be || NULL == be->be_database->plg_upgradedb ||
strcasecmp(database_type, be->be_database->plg_name)) {
LDAPDebug(LDAP_DEBUG_ANY,