summaryrefslogtreecommitdiff
path: root/source3/registry/regfio.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/registry/regfio.c')
-rw-r--r--source3/registry/regfio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c
index f7ea58f8a3..3a554177a4 100644
--- a/source3/registry/regfio.c
+++ b/source3/registry/regfio.c
@@ -1823,8 +1823,12 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
memcpy( nk->subkeys.header, "lf", REC_HDR_SIZE );
nk->subkeys.num_keys = nk->num_subkeys;
- if ( !(nk->subkeys.hashes = TALLOC_ZERO_ARRAY( file->mem_ctx, REGF_HASH_REC, nk->subkeys.num_keys )) )
- return NULL;
+ if (nk->subkeys.num_keys) {
+ if ( !(nk->subkeys.hashes = TALLOC_ZERO_ARRAY( file->mem_ctx, REGF_HASH_REC, nk->subkeys.num_keys )) )
+ return NULL;
+ } else {
+ nk->subkeys.hashes = NULL;
+ }
nk->subkey_index = 0;
/* update the max_bytes_subkey{name,classname} fields */