r200: fix compile errors
authorHerb Lewis <herb@samba.org>
Tue, 13 Apr 2004 17:34:37 +0000 (17:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:51:16 +0000 (12:51 -0500)
(This used to be commit c64132ddc6396a599a2e13b893e8abf1f731478f)

source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
source4/lib/registry/reg_backend_w95/reg_backend_w95.c

index 74d7bbd3b155652e634b3494fa6c75c20176db0a..9a3005457e8ab59952c2b50e37872e3214cfe6af 100644 (file)
@@ -1575,11 +1575,12 @@ static WERROR nt_close_registry (REG_HANDLE *h)
 
 static WERROR nt_open_registry (REG_HANDLE *h, const char *location, const char *credentials) 
 {
-       REGF *regf = (REGF *)talloc_p(h->mem_ctx, REGF);
+       REGF *regf;
        REGF_HDR *regf_hdr;
        unsigned int regf_id, hbin_id;
        HBIN_HDR *hbin_hdr;
 
+       regf = (REGF *)talloc_p(h->mem_ctx, REGF);
        memset(regf, 0, sizeof(REGF));
        regf->owner_sid_str = credentials;
        h->backend_data = regf;
index 31abd698545de4e71aae747dd915e00ddd99d677..cd07e0a1793f78abfadff12c105baedf1ba6cd1b 100644 (file)
@@ -224,13 +224,15 @@ static WERROR w95_get_subkey_by_index (REG_KEY *parent, int n, REG_KEY **key)
 
 static WERROR w95_open_reg (REG_HANDLE *h, const char *location, const char *credentials)
 {
-       CREG *creg = talloc_p(h->mem_ctx, CREG);
+       CREG *creg;
        DWORD creg_id, rgkn_id;
-       memset(creg, 0, sizeof(CREG));
-       h->backend_data = creg;
        DWORD i, nfree = 0;
        DWORD offset, end_offset;
 
+       creg = talloc_p(h->mem_ctx, CREG);
+       memset(creg, 0, sizeof(CREG));
+       h->backend_data = creg;
+
        if((creg->fd = open(location, O_RDONLY, 0000)) < 0) {
                return WERR_FOOBAR;
        }