summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/hive.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source4/lib/registry/hive.c b/source4/lib/registry/hive.c
index dc38fc8215..d79135fadb 100644
--- a/source4/lib/registry/hive.c
+++ b/source4/lib/registry/hive.c
@@ -43,15 +43,14 @@ _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
}
num = read(fd, peek, 20);
+ close(fd);
if (num == -1) {
return WERR_BADFILE;
}
if (!strncmp(peek, "regf", 4)) {
- close(fd);
return reg_open_regf_file(parent_ctx, location, root);
} else if (!strncmp(peek, "TDB file", 8)) {
- close(fd);
return reg_open_ldb_file(parent_ctx, location, session_info,
credentials, ev_ctx, lp_ctx, root);
}