diff options
author | Gerald Carter <jerry@samba.org> | 2002-07-22 21:02:18 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-07-22 21:02:18 +0000 |
commit | 029fba81c660f8a27f4b61f34ecb118f5018efda (patch) | |
tree | 8c715c8ff42841c524416ee28ed3a32c6fe66958 /source3/registry | |
parent | 36606f727d07cc454f2a3106ef599376fa0635f7 (diff) | |
download | samba-029fba81c660f8a27f4b61f34ecb118f5018efda.tar.gz samba-029fba81c660f8a27f4b61f34ecb118f5018efda.tar.bz2 samba-029fba81c660f8a27f4b61f34ecb118f5018efda.zip |
fix seg fault due to memory allocation goof.
(This used to be commit 8e94f68a80bda0cbc989fb36466dfbc17a07079d)
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_frontend.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c index 6e550c1a0d..d8a10940fd 100644 --- a/source3/registry/reg_frontend.c +++ b/source3/registry/reg_frontend.c @@ -304,6 +304,8 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type, { len = strlen( name ); + /* allocate a slot in the array of pointers */ + if ( ctr->num_values == 0 ) ctr->values = talloc( ctr->ctx, sizeof(REGISTRY_VALUE*) ); else { @@ -312,6 +314,12 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type, ctr->values = ppreg; } + /* allocate a new valuie and store the pointer in the arrya */ + + ctr->values[ctr->num_values] = talloc( ctr->ctx, sizeof(REGISTRY_VALUE) ); + + /* init the value */ + fstrcpy( ctr->values[ctr->num_values]->valuename, name ); ctr->values[ctr->num_values]->type = type; switch ( type ) |