r24999: Use the new regval_compose() function in regval_ctr_addvalue().
authorMichael Adam <obnox@samba.org>
Fri, 7 Sep 2007 14:54:30 +0000 (14:54 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:32 +0000 (12:30 -0500)
Michael

source/registry/reg_objects.c

index ba37b9014b540ca501f790ba1b56cafcaa79a7f4..499b7c350fee7a562c9404e326d42b303aa4e687 100644 (file)
@@ -329,27 +329,12 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, const char *name, uint16 type,
 
        /* allocate a new value and store the pointer in the arrya */
                
-       ctr->values[ctr->num_values] = TALLOC_P( ctr, REGISTRY_VALUE);
-       if (!ctr->values[ctr->num_values]) {
+       ctr->values[ctr->num_values] = regval_compose(ctr, name, type, data_p,
+                                                     size);
+       if (ctr->values[ctr->num_values] == NULL) {
                ctr->num_values = 0;
                return 0;
        }
-
-       /* init the value */
-       
-       fstrcpy( ctr->values[ctr->num_values]->valuename, name );
-       ctr->values[ctr->num_values]->type = type;
-       if (size) {
-               ctr->values[ctr->num_values]->data_p = (uint8 *)TALLOC_MEMDUP(
-                       ctr, data_p, size );
-               if (!ctr->values[ctr->num_values]->data_p) {
-                       ctr->num_values = 0;
-                       return 0;
-               }
-       } else {
-               ctr->values[ctr->num_values]->data_p = NULL;
-       }
-       ctr->values[ctr->num_values]->size = size;
        ctr->num_values++;
 
        return ctr->num_values;