Browse Source

Bug 688341 - (cov#10706,10707) Fix Coverity code maintainability issues

We are calling computing the size of memory needed by calculating
the number of pointers to put in the array, but we are not using
the correct pointer type.
Nathan Kinder 14 years ago
parent
commit
5004279ad8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ldap/servers/slapd/vattr.c

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

@@ -983,9 +983,9 @@ int slapi_vattr_namespace_values_get_sp(vattr_context *c,
 		if(attr_count > 0)
 		{	
 
-			*results = (Slapi_ValueSet**)slapi_ch_calloc(1, sizeof(*results) * attr_count);
+			*results = (Slapi_ValueSet**)slapi_ch_calloc(1, sizeof(**results) * attr_count);
 			*type_name_disposition = (int *)slapi_ch_malloc(sizeof(**type_name_disposition)  * attr_count);
-			*actual_type_name = (char**)slapi_ch_malloc(sizeof(*actual_type_name)  * attr_count);
+			*actual_type_name = (char**)slapi_ch_malloc(sizeof(**actual_type_name)  * attr_count);
 
 			/* For attributes which are in the entry, we just need to get to the Slapi_Attr structure and yank out the slapi_value_set 
 			   structure. We either return a pointer directly to it, or we copy it, depending upon whether the caller asked us to try to