Browse Source

Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093

https://bugzilla.redhat.com/show_bug.cgi?id=617630
Bug description: CID 12090 was a false positive
description: Undo the commit e23c8bd9994d5592738cb44e1c2b426aba7fbd4a
Noriko Hosoi 15 years ago
parent
commit
50aff5657f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ldap/servers/slapd/entrywsi.c

+ 2 - 2
ldap/servers/slapd/entrywsi.c

@@ -475,6 +475,7 @@ entry_add_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **b
 			/* Append the pending values to a->a_present_values */
 			valuearray_update_csn (valuestoadd,CSN_TYPE_VALUE_UPDATED,csn);
 			valueset_add_valuearray_ext(&a->a_present_values, valuestoadd, SLAPI_VALUE_FLAG_PASSIN);
+			slapi_ch_free ( (void **)&valuestoadd );
 
 			/*
 			 * Now delete non-RDN values from a->a_present_values; and
@@ -521,11 +522,10 @@ entry_add_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **b
 			}
 			valuearray_update_csn(valuestoadd,CSN_TYPE_VALUE_UPDATED,csn);
 			retVal= attr_add_valuearray(a, valuestoadd, slapi_entry_get_dn_const(e));
+			valuearray_free(&valuestoadd);
 		}
 		a->a_flags = a_flags_orig;
 	}
-
-	valuearray_free(&valuestoadd);
 	return(retVal);
 }