Thanks, Mark
>From 5d6f2f572a7cdefcf7cc9a8a3bab6fd4c7640c44 Mon Sep 17 00:00:00 2001 From: Mark Reynolds <mareynol@xxxxxxxxxx> Date: Mon, 9 Apr 2012 15:56:46 -0400 Subject: [PATCH] Coverity Fixes Bug Description: Fixes coverity errors from ticket 315 & 20 --- ldap/servers/plugins/automember/automember.c | 12 ++---------- ldap/servers/slapd/daemon.c | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c index d638374..17590ef 100644 --- a/ldap/servers/plugins/automember/automember.c +++ b/ldap/servers/plugins/automember/automember.c @@ -2043,7 +2043,6 @@ automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int rv = SLAPI_DSE_CALLBACK_OK; task_data *mytaskdata = NULL; Slapi_Task *task = NULL; - Slapi_DN *basedn = NULL; PRThread *thread = NULL; char *bind_dn = NULL; const char *base_dn; @@ -2067,9 +2066,6 @@ automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, *returncode = LDAP_OBJECT_CLASS_VIOLATION; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; - } else { - /* convert the base_dn to a slapi dn */ - basedn = slapi_sdn_new_dn_byval(base_dn); } if((filter = fetch_attr(e, "filter", 0)) == NULL){ *returncode = LDAP_OBJECT_CLASS_VIOLATION; @@ -2089,7 +2085,7 @@ automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, slapi_pblock_get(pb, SLAPI_REQUESTOR_DN, &bind_dn); mytaskdata->bind_dn = slapi_ch_strdup(bind_dn); - mytaskdata->base_dn = basedn; + mytaskdata->base_dn = slapi_sdn_new_dn_byval(base_dn); mytaskdata->filter_str = slapi_ch_strdup(filter); if(scope){ if(strcasecmp(scope,"sub")== 0){ @@ -2236,7 +2232,6 @@ automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry int rv = SLAPI_DSE_CALLBACK_OK; task_data *mytaskdata = NULL; Slapi_Task *task = NULL; - Slapi_DN *basedn = NULL; PRThread *thread = NULL; char *bind_dn = NULL; const char *base_dn = NULL; @@ -2264,9 +2259,6 @@ automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *returncode = LDAP_OBJECT_CLASS_VIOLATION; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; - } else { - /* convert the base dn to a slapi dn */ - basedn = slapi_sdn_new_dn_byval(base_dn); } if((filter = fetch_attr(e, "filter", 0)) == NULL){ *returncode = LDAP_OBJECT_CLASS_VIOLATION; @@ -2285,7 +2277,7 @@ automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry } mytaskdata->bind_dn = slapi_ch_strdup(bind_dn); mytaskdata->ldif_out = slapi_ch_strdup(ldif); - mytaskdata->base_dn = basedn; + mytaskdata->base_dn = slapi_sdn_new_dn_byval(base_dn); mytaskdata->filter_str = slapi_ch_strdup(filter); if(scope){ if(strcasecmp(scope,"sub")== 0){ diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index 01d307d..597e131 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -629,6 +629,7 @@ disk_mon_get_dirs(char ***list, int logs_critical){ } be = (backend *)slapi_get_next_backend (cookie); } + slapi_ch_free((void **)&cookie); } /* -- 1.7.1
-- 389-devel mailing list 389-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/389-devel