diff options
author | Michael Adam <obnox@samba.org> | 2007-09-07 14:54:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:32 -0500 |
commit | 30ee281cae04b70e0f2568ab164bbafd55772edc (patch) | |
tree | d3f34aa18990ccb863426af5da688cf2348c863c /source3 | |
parent | cc7bc29757c0ea6739e06b96775c7c2b9a57f8ce (diff) | |
download | samba-30ee281cae04b70e0f2568ab164bbafd55772edc.tar.gz samba-30ee281cae04b70e0f2568ab164bbafd55772edc.tar.bz2 samba-30ee281cae04b70e0f2568ab164bbafd55772edc.zip |
r24999: Use the new regval_compose() function in regval_ctr_addvalue().
Michael
(This used to be commit dab9ffe602eaca478a73f3b882f543629ce3001e)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_objects.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c index ba37b9014b..499b7c350f 100644 --- a/source3/registry/reg_objects.c +++ b/source3/registry/reg_objects.c @@ -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; |