From 3c0a9c46d8057b9499d7d48a67ba15f9942d558a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 19 Jul 2002 22:16:03 +0000 Subject: fixed seg fault in registry frontend caused by trying to use a destroyed TALLOC_CTX* (This used to be commit 432b9f8d7c20fbf3b2a0906c8a93272abbe43fb6) --- source3/registry/reg_frontend.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'source3/registry/reg_frontend.c') diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c index 3e3ec49425..6090245096 100644 --- a/source3/registry/reg_frontend.c +++ b/source3/registry/reg_frontend.c @@ -248,11 +248,10 @@ char* regsubkey_ctr_specific_key( REGSUBKEY_CTR *ctr, uint32 key_index ) void regsubkey_ctr_destroy( REGSUBKEY_CTR *ctr ) { - if ( ctr ) - talloc_destroy( ctr->ctx ); - - ctr->num_subkeys = 0; - ctr->subkeys = NULL; + if ( ctr ) { + talloc_destroy( ctr->ctx ); + ZERO_STRUCTP( ctr ); + } } @@ -285,10 +284,9 @@ int regval_ctr_numvals( REGVAL_CTR *ctr ) void regval_ctr_destroy( REGVAL_CTR *ctr ) { - if ( ctr ) + if ( ctr ) { talloc_destroy( ctr->ctx ); - - ctr->num_values = 0; - ctr->values = NULL; + ZERO_STRUCTP( ctr ); + } } -- cgit