summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_reg_nt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_reg_nt.c b/source3/rpc_server/srv_reg_nt.c
index 33711d0fac..5ac6738b99 100644
--- a/source3/rpc_server/srv_reg_nt.c
+++ b/source3/rpc_server/srv_reg_nt.c
@@ -835,8 +835,10 @@ static WERROR restore_registry_key ( REGISTRY_KEY *krecord, const char *fname )
/* get the rootkey from the regf file and then load the tree
via recursive calls */
- if ( !(rootkey = regfio_rootkey( regfile )) )
+ if ( !(rootkey = regfio_rootkey( regfile )) ) {
+ regfio_close( regfile );
return WERR_REG_FILE_INVALID;
+ }
result = reg_load_tree( regfile, krecord->name, rootkey );