From 110546612d0e004363cee2dc77fd451967940ebc Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Fri, 2 Jul 2010 11:35:42 -0700 Subject: 610281 - fix coverity Defect Type: Control flow issues https://bugzilla.redhat.com/show_bug.cgi?id=610281 11800 DEADCODE Triaged Unassigned Bug Minor Fix Required cos_cache_add_defn() ds/ldap/servers/plugins/cos/cos_cache.c Comment: If theDef points to the allocated memory at the line 1410, ret never becomes -1. Thus, theDef never be non-NULL at 1497. Removing 1497 if(theDef) 1498 slapi_ch_free((void**)&theDef); 11801 DEADCODE Triaged Unassigned Bug Minor Fix Required cos_cache_follow_pointer() ds/ldap/servers/plugins/cos/cos_cache.c Comment: default is not needed: 3525 default: 3526 goto bail; --- ldap/servers/plugins/cos/cos_cache.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c index bc79ee5c..89902f84 100644 --- a/ldap/servers/plugins/cos/cos_cache.c +++ b/ldap/servers/plugins/cos/cos_cache.c @@ -1494,8 +1494,6 @@ static int cos_cache_add_defn( cos_cache_del_attrval_list(spec); if(pAttrs) cos_cache_del_attrval_list(pAttrs); - if(theDef) - slapi_ch_free((void**)&theDef); } LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_add_defn\n",0,0,0); @@ -3521,9 +3519,6 @@ static int cos_cache_follow_pointer( vattr_context *c, const char *dn, char *typ /* this must be a compare op */ ret = slapi_vattr_value_compare_sp(c, pEntryList[0],type, test_this, result, flags); break; - - default: - goto bail; } } } -- cgit