Browse Source

610281 - fix coverity Defect Type: Control flow issues

https://bugzilla.redhat.com/show_bug.cgi?id=610281

11802 DEADCODE Triaged Unassigned Bug Minor Ignore
dna_get_next_value() ds/ldap/servers/plugins/dna/dna.c

Comment:
Merged 2 pblock destroy codes slapi_pblock_destroy(pb) to
one at the end of the function dna_get_next_value.
Noriko Hosoi 15 years ago
parent
commit
40cbfa6cc5
1 changed files with 2 additions and 4 deletions
  1. 2 4
      ldap/servers/plugins/dna/dna.c

+ 2 - 4
ldap/servers/plugins/dna/dna.c

@@ -2016,9 +2016,6 @@ static int dna_get_next_value(struct configEntry *config_entry,
         slapi_modify_internal_pb(pb);
 
         slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret);
-
-        slapi_pblock_destroy(pb);
-        pb = NULL;
     }
 
     if (LDAP_SUCCESS == ret) {
@@ -2036,8 +2033,9 @@ static int dna_get_next_value(struct configEntry *config_entry,
   done:
     slapi_unlock_mutex(config_entry->lock);
 
-    if (pb)
+    if (pb) {
         slapi_pblock_destroy(pb);
+    }
 
     slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM,
                     "<-- dna_get_next_value\n");