r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
authorGerald Carter <jerry@samba.org>
Mon, 20 Feb 2006 17:59:58 +0000 (17:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:10:14 +0000 (11:10 -0500)
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)

61 files changed:
source3/auth/auth_compat.c
source3/auth/auth_ntlmssp.c
source3/auth/auth_server.c
source3/auth/auth_util.c
source3/groupdb/mapping.c
source3/lib/events.c
source3/lib/genrand.c
source3/lib/smbldap_util.c
source3/lib/talloctort.c
source3/lib/username.c
source3/lib/util.c
source3/lib/util_pw.c
source3/lib/util_str.c
source3/libmsrpc/cac_lsarpc.c
source3/libmsrpc/cac_samr.c
source3/libmsrpc/cac_svcctl.c
source3/libmsrpc/cac_winreg.c
source3/libmsrpc/libmsrpc_internal.c
source3/libsmb/libsmbclient.c
source3/libsmb/ntlmssp_sign.c
source3/locking/locking.c
source3/nmbd/nmbd.c
source3/nsswitch/winbindd.c
source3/nsswitch/winbindd_cred_cache.c
source3/nsswitch/winbindd_dual.c
source3/nsswitch/winbindd_ldap.c
source3/nsswitch/winbindd_pam.c
source3/param/loadparm.c
source3/passdb/lookup_sid.c
source3/passdb/passdb.c
source3/passdb/pdb_interface.c
source3/passdb/pdb_ldap.c
source3/passdb/pdb_nds.c
source3/passdb/pdb_smbpasswd.c
source3/passdb/secrets.c
source3/passdb/util_unixsids.c
source3/rpc_parse/parse_misc.c
source3/rpc_server/srv_netlog_nt.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_pipe_hnd.c
source3/rpcclient/cmd_spoolss.c
source3/sam/idmap_ldap.c
source3/smbd/close.c
source3/smbd/conn.c
source3/smbd/lanman.c
source3/smbd/open.c
source3/smbd/oplock.c
source3/smbd/password.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/sec_ctx.c
source3/smbd/server.c
source3/smbd/service.c
source3/smbd/share_access.c
source3/smbd/uid.c
source3/utils/net_rpc_shell.c
source3/utils/ntlm_auth.c
source3/utils/pdbedit.c
source3/utils/smbcontrol.c
source3/utils/smbpasswd.c
source3/web/cgi.c

index 28b9de8d4312060a3c844145c63a1088a8e9d429..bd5d7f02290cec6121f095ab67551f113152febf 100644 (file)
@@ -84,7 +84,7 @@ static NTSTATUS pass_check_smb(const char *smb_name,
        } else {
                nt_status = check_plaintext_password(smb_name, plaintext_password, &server_info);
        }               
-       talloc_free(server_info);
+       TALLOC_FREE(server_info);
        return nt_status;
 }
 
index 2bf86860cc1469bec7029c8740d9f208bda89623..1d3d17d60dda405a5a0690e2095e55a4b4cd0ef0 100644 (file)
@@ -187,7 +187,7 @@ void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
                ((*auth_ntlmssp_state)->auth_context->free)(&(*auth_ntlmssp_state)->auth_context);
        }
        if ((*auth_ntlmssp_state)->server_info) {
-               talloc_free((*auth_ntlmssp_state)->server_info);
+               TALLOC_FREE((*auth_ntlmssp_state)->server_info);
        }
        talloc_destroy(mem_ctx);
        *auth_ntlmssp_state = NULL;
index 8eed8bba6a40efd60e4286b0a74efd4f26cb8a7b..7bec1b4128daa4c5e47ad5d63a57d689f416db3e 100644 (file)
@@ -384,7 +384,7 @@ use this machine as the password server.\n"));
                        real_username, True )) != NULL ) 
                {
                        nt_status = make_server_info_pw(server_info, pass->pw_name, pass);
-                       talloc_free(pass);
+                       TALLOC_FREE(pass);
                }
                else
                {
index ad02b24a428a61fcefbfd87e57b394d4291c204c..3e7c520fc5da1908d053cb1faa6061e028dfd027 100644 (file)
@@ -522,7 +522,7 @@ static int server_info_dtor(void *p)
 }
 
 /***************************************************************************
- Make a server_info struct. Free with talloc_free().
+ Make a server_info struct. Free with TALLOC_FREE().
 ***************************************************************************/
 
 static auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx)
@@ -565,7 +565,7 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info,
        }
 
        if ( !(result = make_server_info(NULL)) ) {
-               talloc_free(pwd);
+               TALLOC_FREE(pwd);
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -574,7 +574,7 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info,
        result->gid = pwd->pw_gid;
        result->uid = pwd->pw_uid;
        
-       talloc_free(pwd);
+       TALLOC_FREE(pwd);
 
        status = pdb_enum_group_memberships(result, sampass,
                                            &result->sids, &gids,
@@ -584,14 +584,14 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info,
                DEBUG(10, ("pdb_enum_group_memberships failed: %s\n",
                           nt_errstr(status)));
                result->sam_account = NULL; /* Don't free on error exit. */
-               talloc_free(result);
+               TALLOC_FREE(result);
                return status;
        }
 
        /* For now we throw away the gids and convert via sid_to_gid
         * later. This needs fixing, but I'd like to get the code straight and
         * simple first. */
-       talloc_free(gids);
+       TALLOC_FREE(gids);
 
        DEBUG(5,("make_server_info_sam: made server info for user %s -> %s\n",
                 pdb_get_username(sampass), result->unix_name));
@@ -793,7 +793,7 @@ static struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
        talloc_steal(mem_ctx, result);
 
  done:
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(tmp_ctx);
        return result;
 }
 
@@ -846,7 +846,7 @@ NTSTATUS create_local_token(auth_serversupplied_info *server_info)
 
        status = log_nt_token(mem_ctx, server_info->ptok);
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return status;
 }
 
@@ -1014,7 +1014,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
 
        result = NT_STATUS_OK;
  done:
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(tmp_ctx);
        return result;
 }
 
@@ -1052,7 +1052,7 @@ BOOL user_in_group_sid(const char *username, const DOM_SID *group_sid)
 
        result = nt_token_check_sid(group_sid, token);
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
        
 }
@@ -1072,7 +1072,7 @@ BOOL user_in_group(const char *username, const char *groupname)
 
        ret = lookup_name(mem_ctx, groupname, LOOKUP_NAME_ALL,
                          NULL, NULL, &group_sid, NULL);
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
 
        if (!ret) {
                DEBUG(10, ("lookup_name(%s) failed: %s\n", groupname,
@@ -1182,14 +1182,14 @@ NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info,
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(10, ("pdb_enum_group_memberships failed: %s\n",
                           nt_errstr(status)));
-               talloc_free(result);
+               TALLOC_FREE(result);
                return status;
        }
 
        /* For now we throw away the gids and convert via sid_to_gid
         * later. This needs fixing, but I'd like to get the code straight and
         * simple first. */
-       talloc_free(gids);
+       TALLOC_FREE(gids);
 
        *server_info = result;
 
@@ -1349,7 +1349,7 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx,
                *found_username));
 
        nt_status = pdb_init_sam_pw(sam_account, passwd);
-       talloc_free(passwd);
+       TALLOC_FREE(passwd);
        return nt_status;
 }
 
@@ -1622,7 +1622,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                                 info3->gids[i].g_rid)) {
                        DEBUG(3,("could not append additional group rid "
                                 "0x%x\n", info3->gids[i].g_rid));
-                       talloc_free(result);
+                       TALLOC_FREE(result);
                        return NT_STATUS_INVALID_PARAMETER;
                }
                add_sid_to_array(result, &sid, &result->sids,
@@ -1742,7 +1742,7 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, NT_USER_TOKEN *ptoken)
 
        if ((ptoken->user_sids != NULL) && (token->user_sids == NULL)) {
                DEBUG(0, ("talloc_memdup failed\n"));
-               talloc_free(token);
+               TALLOC_FREE(token);
                return NULL;
        }
 
index 07116f41fb606b2a827457f8cead55cb6e2c0667..4aa1c627b7a6bb9ebda8787776cc7c8b6b97614e 100644 (file)
@@ -1078,7 +1078,7 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods,
 
        exists = lookup_name(mem_ctx, name, LOOKUP_NAME_ISOLATED,
                             NULL, NULL, &sid, &type);
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
 
        if (exists) {
                return NT_STATUS_ALIAS_EXISTS;
index 3670d960aaebe8ab3751b42b416635b82085d7c5..133752c78e40380533e44b6829ab96f86b381274 100644 (file)
@@ -33,8 +33,8 @@ static int timed_event_destructor(void *p)
 }
 
 /****************************************************************************
- Schedule a function for future calling, cancel with talloc_free().
- It's the responsibility of the handler to call talloc_free() on the event
+ Schedule a function for future calling, cancel with TALLOC_FREE().
+ It's the responsibility of the handler to call TALLOC_FREE() on the event
  handed to it.
 ****************************************************************************/
 
index 5b643bf297ef7503fea19895a1347eaa6be24fb9..1897b86818b84eec5ea4cb4a780885731545863d 100644 (file)
@@ -121,7 +121,7 @@ static int do_reseed(BOOL use_fd, int fd)
                mdfour(md4_tmp, (unsigned char *)pw->pw_passwd, strlen(pw->pw_passwd));
                for (i=0;i<16;i++)
                        seed_inbuf[8+i] ^= md4_tmp[i];
-               talloc_free(pw);
+               TALLOC_FREE(pw);
        }
 
        /*
index 7b4cf4d079f8ffa6e636091d533892dc5a16202a..64e2a5eae47de8a2aac9dd58530f0bf0bb1d7240 100644 (file)
@@ -109,7 +109,7 @@ static NTSTATUS add_new_domain_info(struct smbldap_state *ldap_state,
 
        attr_list = get_attr_list( NULL, dominfo_attr_list );
        rc = smbldap_search_suffix(ldap_state, filter, attr_list, &result);
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
 
        if (rc != LDAP_SUCCESS) {
                return NT_STATUS_UNSUCCESSFUL;
@@ -217,7 +217,7 @@ NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
 
        attr_list = get_attr_list( NULL, dominfo_attr_list );
        rc = smbldap_search_suffix(ldap_state, filter, attr_list , result);
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
 
        if (rc != LDAP_SUCCESS) {
                DEBUG(2,("Problem during LDAPsearch: %s\n", ldap_err2string (rc)));
index 6504203a7ad5216de5092f438f99f4100f025adf..de5552b5d00ac232f984a71e6a850f3c4a8cf424 100644 (file)
@@ -105,7 +105,7 @@ static BOOL test_ref1(void)
        CHECK_BLOCKS(r1, 2);
 
        printf("Freeing p2\n");
-       talloc_free(p2);
+       TALLOC_FREE(p2);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(p1, 5);
@@ -113,13 +113,13 @@ static BOOL test_ref1(void)
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing p1\n");
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing r1\n");
-       talloc_free(r1);
+       TALLOC_FREE(r1);
        talloc_report_full(NULL, stdout);
 
        printf("Testing NULL\n");
@@ -131,7 +131,7 @@ static BOOL test_ref1(void)
 
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -161,7 +161,7 @@ static BOOL test_ref2(void)
        CHECK_BLOCKS(r1, 2);
 
        printf("Freeing ref\n");
-       talloc_free(ref);
+       TALLOC_FREE(ref);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(p1, 5);
@@ -169,25 +169,25 @@ static BOOL test_ref2(void)
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing p2\n");
-       talloc_free(p2);
+       TALLOC_FREE(p2);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(p1, 4);
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing p1\n");
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing r1\n");
-       talloc_free(r1);
+       TALLOC_FREE(r1);
        talloc_report_full(root, stdout);
 
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -213,19 +213,19 @@ static BOOL test_ref3(void)
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing p1\n");
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(p2, 2);
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing p2\n");
-       talloc_free(p2);
+       TALLOC_FREE(p2);
        talloc_report_full(root, stdout);
 
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -255,25 +255,25 @@ static BOOL test_ref4(void)
        CHECK_BLOCKS(r1, 2);
 
        printf("Freeing r1\n");
-       talloc_free(r1);
+       TALLOC_FREE(r1);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(p1, 5);
        CHECK_BLOCKS(p2, 1);
 
        printf("Freeing p2\n");
-       talloc_free(p2);
+       TALLOC_FREE(p2);
        talloc_report_full(root, stdout);
 
        CHECK_BLOCKS(p1, 4);
 
        printf("Freeing p1\n");
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_report_full(root, stdout);
 
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -312,12 +312,12 @@ static BOOL test_unlink1(void)
        CHECK_BLOCKS(r1, 1);
 
        printf("Freeing p1\n");
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_report_full(root, stdout);
 
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -352,7 +352,7 @@ static BOOL test_misc(void)
        talloc_increase_ref_count(p1);
        CHECK_BLOCKS(p1, 1);
        CHECK_BLOCKS(root, 2);
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        CHECK_BLOCKS(p1, 1);
        CHECK_BLOCKS(root, 2);
        talloc_unlink(NULL, p1);
@@ -367,7 +367,7 @@ static BOOL test_misc(void)
                printf("failed: talloc_unlink() of parent should succeed\n");
                return False;
        }
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        CHECK_BLOCKS(p1, 1);
        CHECK_BLOCKS(root, 2);
 
@@ -388,13 +388,13 @@ static BOOL test_misc(void)
        CHECK_BLOCKS(root, 3);
        
 
-       if (talloc_free(NULL) != -1) {
-               printf("talloc_free(NULL) should give -1\n");
+       if (TALLOC_FREE(NULL) != -1) {
+               printf("TALLOC_FREE(NULL) should give -1\n");
                return False;
        }
 
        talloc_set_destructor(p1, fail_destructor);
-       if (talloc_free(p1) != -1) {
+       if (TALLOC_FREE(p1) != -1) {
                printf("Failed destructor should cause talloc_free to fail\n");
                return False;
        }
@@ -408,7 +408,7 @@ static BOOL test_misc(void)
                printf("Failed to give zero memory\n");
                return False;
        }
-       talloc_free(p2);
+       TALLOC_FREE(p2);
 
        if (talloc_strdup(root, NULL) != NULL) {
                printf("failed: strdup on NULL should give NULL\n");
@@ -435,7 +435,7 @@ static BOOL test_misc(void)
        }
        CHECK_BLOCKS(p2, 1);
        CHECK_BLOCKS(p1, 3);
-       talloc_free(p2);
+       TALLOC_FREE(p2);
 
        d = talloc_array(p1, double, 0x20000000);
        if (d) {
@@ -449,7 +449,7 @@ static BOOL test_misc(void)
                return False;
        }
 
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        CHECK_BLOCKS(root, 1);
 
        p1 = talloc_named(root, 100, "%d bytes", 100);
@@ -500,7 +500,7 @@ static BOOL test_misc(void)
 
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        CHECK_SIZE(NULL, 0);
 
@@ -564,7 +564,7 @@ static BOOL test_realloc(void)
        CHECK_BLOCKS(root, 1);
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -609,7 +609,7 @@ static BOOL test_realloc_child(void)
        el1->list2 = talloc_realloc(el1, el1->list2, struct el2 *, 200);
        el1->list3 = talloc_realloc(el1, el1->list3, struct el2 *, 300);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -651,7 +651,7 @@ static BOOL test_type(void)
                return False;
        }
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -691,21 +691,21 @@ static BOOL test_steal(void)
        CHECK_BLOCKS(root, 1);
        CHECK_SIZE(root, 0);
 
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_steal(root, p2);
        CHECK_BLOCKS(root, 2);
        CHECK_SIZE(root, 20);
        
-       talloc_free(p2);
+       TALLOC_FREE(p2);
 
        CHECK_BLOCKS(root, 1);
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
        p1 = talloc_size(NULL, 3);
        CHECK_SIZE(NULL, 3);
-       talloc_free(p1);
+       TALLOC_FREE(p1);
 
        return True;
 }
@@ -731,7 +731,7 @@ static BOOL test_realloc_fn(void)
        CHECK_BLOCKS(root, 1);
        CHECK_SIZE(root, 0);
 
-       talloc_free(root);
+       TALLOC_FREE(root);
 
 
        return True;
@@ -751,13 +751,13 @@ static BOOL test_unref_reparent(void)
        c1 = talloc_named_const(p1, 1, "child");
        talloc_reference(p2, c1);
 
-       talloc_free(p1);
+       TALLOC_FREE(p1);
        talloc_unlink(p2, c1);
 
        CHECK_SIZE(root, 1);
 
-       talloc_free(p2);
-       talloc_free(root);
+       TALLOC_FREE(p2);
+       TALLOC_FREE(root);
 
        return True;
 }
@@ -780,13 +780,13 @@ static BOOL test_speed(void)
                p1 = talloc_size(ctx, count);
                p2 = talloc_strdup(p1, "foo bar");
                p3 = talloc_size(p1, 300);
-               talloc_free(p1);
+               TALLOC_FREE(p1);
                count += 3;
        } while (timeval_elapsed(&tv) < 5.0);
 
        printf("talloc: %.0f ops/sec\n", count/timeval_elapsed(&tv));
 
-       talloc_free(ctx);
+       TALLOC_FREE(ctx);
 
        tv = timeval_current();
        count = 0;
index 52994557f79810cb060aa53421b6885d6938909a..3dcf9e18cc40ce2117912e2b9abf93d78144ad8a 100644 (file)
@@ -161,7 +161,7 @@ struct passwd *Get_Pwnam(const char *user)
        */
 
        if (Get_Pwnam_ret) {
-               talloc_free(Get_Pwnam_ret);
+               TALLOC_FREE(Get_Pwnam_ret);
        }
        
        Get_Pwnam_ret = ret;
index dc57839df3415e1f5be5196dc94725d8fd6d3b69..d4443a64808781ba3f2e259482a85d082b8c2c14 100644 (file)
@@ -1430,7 +1430,7 @@ const char *uidtoname(uid_t uid)
        pass = getpwuid_alloc(NULL, uid);
        if (pass) {
                fstrcpy(name, pass->pw_name);
-               talloc_free(pass);
+               TALLOC_FREE(pass);
        } else {
                slprintf(name, sizeof(name) - 1, "%ld",(long int)uid);
        }
@@ -1467,7 +1467,7 @@ uid_t nametouid(const char *name)
        pass = getpwnam_alloc(NULL, name);
        if (pass) {
                u = pass->pw_uid;
-               talloc_free(pass);
+               TALLOC_FREE(pass);
                return u;
        }
 
index e026affb44768df85da11602a24fa31ad5dee06c..e6328463123a02a7c527171d4a30801f88805750 100644 (file)
@@ -55,7 +55,7 @@ static void init_pwnam_cache(void)
 
 void flush_pwnam_cache(void)
 {
-       talloc_free(pwnam_cache);
+       TALLOC_FREE(pwnam_cache);
        pwnam_cache = NULL;
        init_pwnam_cache();
 }
@@ -96,7 +96,7 @@ struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
                i = rand() % PWNAMCACHE_SIZE;
 
        if (pwnam_cache[i] != NULL) {
-               talloc_free(pwnam_cache[i]);
+               TALLOC_FREE(pwnam_cache[i]);
        }
 
        pwnam_cache[i] = talloc_copy_passwd(pwnam_cache, temp);
index 957ebd57bdd75fe88f854c8ad36777c044af9919..e4aa5dbd51b7d2c3249ec1ddeb42bc7ad2943dab 100644 (file)
@@ -1704,7 +1704,7 @@ static char **str_list_make_internal(TALLOC_CTX *mem_ctx, const char *string, co
                                DEBUG(0,("str_list_make: Unable to allocate memory"));
                                str_list_free(&list);
                                if (mem_ctx) {
-                                       talloc_free(s);
+                                       TALLOC_FREE(s);
                                } else {
                                        SAFE_FREE(s);
                                }
@@ -1724,7 +1724,7 @@ static char **str_list_make_internal(TALLOC_CTX *mem_ctx, const char *string, co
                        DEBUG(0,("str_list_make: Unable to allocate memory"));
                        str_list_free(&list);
                        if (mem_ctx) {
-                               talloc_free(s);
+                               TALLOC_FREE(s);
                        } else {
                                SAFE_FREE(s);
                        }
@@ -1735,7 +1735,7 @@ static char **str_list_make_internal(TALLOC_CTX *mem_ctx, const char *string, co
        }
 
        if (mem_ctx) {
-               talloc_free(s);
+               TALLOC_FREE(s);
        } else {
                SAFE_FREE(s);
        }
@@ -1823,13 +1823,13 @@ static void str_list_free_internal(TALLOC_CTX *mem_ctx, char ***list)
        tlist = *list;
        for(; *tlist; tlist++) {
                if (mem_ctx) {
-                       talloc_free(*tlist);
+                       TALLOC_FREE(*tlist);
                } else {
                        SAFE_FREE(*tlist);
                }
        }
        if (mem_ctx) {
-               talloc_free(*tlist);
+               TALLOC_FREE(*tlist);
        } else {
                SAFE_FREE(*list);
        }
index b157f33c69f23fdafc34ae45eed1d27d37250c59..bfd58ed1ec454c6450d7dba852e7c60177032256 100644 (file)
@@ -424,7 +424,7 @@ int cac_LsaFetchSid(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaFetchSi
       op->out.local_sid->domain = dom_name;
       
       sid_copy(&op->out.local_sid->sid, local_sid);
-      talloc_free(local_sid);
+      TALLOC_FREE(local_sid);
    }
 
 domain:
@@ -453,7 +453,7 @@ domain:
 
       op->out.domain_sid->domain = dom_name;
       sid_copy(&op->out.domain_sid->sid, domain_sid);
-      talloc_free(domain_sid);
+      TALLOC_FREE(domain_sid);
    }
    
 done:
@@ -816,7 +816,7 @@ int cac_LsaOpenAccount(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaOpen
    hnd->status = rpccli_lsa_open_account(pipe_hnd, mem_ctx, op->in.pol, op->in.sid, op->in.access, user_pol);
 
    if(!NT_STATUS_IS_OK(hnd->status)) {
-      talloc_free(user_pol);
+      TALLOC_FREE(user_pol);
       return CAC_FAILURE;
    }
 
index bf34ec55b830cffbc38907e72316fbd76e8c0f41..7f39e76813f798bb3bb4b8f9815b4a9d04693330 100644 (file)
@@ -300,7 +300,7 @@ int cac_SamOpenUser(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamOpenUse
          return CAC_FAILURE;
       }
 
-      talloc_free(rid_types);
+      TALLOC_FREE(rid_types);
 
    }
    else {
@@ -518,8 +518,8 @@ int cac_SamGetNamesFromRids(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct Sa
       map_out[i].rid = op->in.rids[i];
    }
 
-   talloc_free(names_out);
-   talloc_free(name_types_out);
+   TALLOC_FREE(names_out);
+   TALLOC_FREE(name_types_out);
    
    op->out.num_names = num_names_out;
    op->out.map       = map_out;
@@ -602,8 +602,8 @@ int cac_SamGetRidsFromNames(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct Sa
    op->out.num_rids = num_rids_out;
    op->out.map      = map_out;
 
-   talloc_free(rids_out);
-   talloc_free(rid_types_out);
+   TALLOC_FREE(rids_out);
+   TALLOC_FREE(rid_types_out);
    
    if(NT_STATUS_EQUAL(hnd->status, STATUS_SOME_UNMAPPED))
       return CAC_PARTIAL_SUCCESS;
@@ -665,7 +665,7 @@ int cac_SamGetGroupsForUser(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct Sa
       attr_out[i] = groups[i].attr;
    }
 
-   talloc_free(groups);
+   TALLOC_FREE(groups);
 
    op->out.num_groups = num_groups_out;
    op->out.rids = rids_out;
@@ -941,7 +941,7 @@ int cac_SamClearGroupMembers(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_H
          result = CAC_FAILURE;
    }
 
-   talloc_free(attr);
+   TALLOC_FREE(attr);
 
    return result;
 }
@@ -1040,24 +1040,24 @@ int cac_SamEnumGroups(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamEnumG
    names_out = talloc_array(mem_ctx, char *, num_groups_out);
    if(!names_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(acct_buf);
+      TALLOC_FREE(acct_buf);
       return CAC_FAILURE;
    }
 
    desc_out = talloc_array(mem_ctx, char *, num_groups_out);
    if(!desc_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(acct_buf);
-      talloc_free(names_out);
+      TALLOC_FREE(acct_buf);
+      TALLOC_FREE(names_out);
       return CAC_FAILURE;
    }
 
    rids_out = talloc_array(mem_ctx, uint32, num_groups_out);
    if(!rids_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(acct_buf);
-      talloc_free(names_out);
-      talloc_free(desc_out);
+      TALLOC_FREE(acct_buf);
+      TALLOC_FREE(names_out);
+      TALLOC_FREE(desc_out);
       return CAC_FAILURE;
    }
 
@@ -1135,24 +1135,24 @@ int cac_SamEnumAliases(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamEnum
    names_out = talloc_array(mem_ctx, char *, num_als_out);
    if(!names_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(acct_buf);
+      TALLOC_FREE(acct_buf);
       return CAC_FAILURE;
    }
 
    desc_out = talloc_array(mem_ctx, char *, num_als_out);
    if(!desc_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(acct_buf);
-      talloc_free(names_out);
+      TALLOC_FREE(acct_buf);
+      TALLOC_FREE(names_out);
       return CAC_FAILURE;
    }
 
    rids_out = talloc_array(mem_ctx, uint32, num_als_out);
    if(!rids_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(acct_buf);
-      talloc_free(names_out);
-      talloc_free(desc_out);
+      TALLOC_FREE(acct_buf);
+      TALLOC_FREE(names_out);
+      TALLOC_FREE(desc_out);
       return CAC_FAILURE;
    }
 
@@ -1438,7 +1438,7 @@ int cac_SamClearAliasMembers(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_H
          result = CAC_FAILURE;
    }
 
-   talloc_free(sid);
+   TALLOC_FREE(sid);
    return result;
 }
 
@@ -2405,7 +2405,7 @@ int cac_SamFlush(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamFlush *op)
    /*this function does not use an output parameter to make it as convenient as possible to use*/
    *op->in.dom_hnd = *od.out.dom_hnd;
 
-   talloc_free(od.out.dom_hnd);
+   TALLOC_FREE(od.out.dom_hnd);
 
    return CAC_SUCCESS;
 }
index 2651be64abcfa03c33c925fb5608e575ed84209c..83dc0364930219ad049f7d2fde9109a1e5af4424 100644 (file)
@@ -154,7 +154,7 @@ int cac_SvcEnumServices(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SvcEnu
       return CAC_FAILURE;
    }
 
-   talloc_free(svc_buf);
+   TALLOC_FREE(svc_buf);
 
    op->out.num_services = num_svc_out;
 
index 1d60cc8fb21b21abe73227b8f52ccb4e3f2720e4..4c24671a38d22070b2e678854e008f09fe8bce96 100644 (file)
@@ -244,15 +244,15 @@ int cac_RegEnumKeys(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegEnumKey
    class_names_out = TALLOC_ARRAY(mem_ctx, char *, op->in.max_keys);
    if(!class_names_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(key_names_out);
+      TALLOC_FREE(key_names_out);
       return CAC_FAILURE;
    }
 
    mod_times_out = TALLOC_ARRAY(mem_ctx, time_t, op->in.max_keys);
    if(!mod_times_out) {
       hnd->status = NT_STATUS_NO_MEMORY;
-      talloc_free(key_names_out);
-      talloc_free(class_names_out);
+      TALLOC_FREE(key_names_out);
+      TALLOC_FREE(class_names_out);
 
       return CAC_FAILURE;
    }
@@ -675,15 +675,15 @@ int cac_RegEnumValues(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegEnumV
 
    values_out = talloc_array(mem_ctx, REG_VALUE_DATA *, op->in.max_values);
    if(!values_out) {
-      talloc_free(types_out);
+      TALLOC_FREE(types_out);
       hnd->status = NT_STATUS_NO_MEMORY;
       return CAC_FAILURE;
    }
 
    val_names_out = talloc_array(mem_ctx, char *, op->in.max_values);
    if(!val_names_out) {
-      talloc_free(types_out);
-      talloc_free(values_out);
+      TALLOC_FREE(types_out);
+      TALLOC_FREE(values_out);
       hnd->status = NT_STATUS_NO_MEMORY;
       return CAC_FAILURE;
    }
index 6a524cdb038d4c516bfc72bda450609d0a51486b..b52bd0d788733182b4adc482ff2b02e50d7abad3 100644 (file)
@@ -163,12 +163,12 @@ RPC_DATA_BLOB *cac_MakeRpcDataBlob(TALLOC_CTX *mem_ctx, uint32 data_type, REG_VA
          break;
 
       default:
-         talloc_free(blob);
+         TALLOC_FREE(blob);
          blob = NULL;
    }
 
    if(!(blob->buffer)) {
-      talloc_free(blob);
+      TALLOC_FREE(blob);
       return NULL;
    }
 
@@ -226,7 +226,7 @@ REG_VALUE_DATA *cac_MakeRegValueData(TALLOC_CTX *mem_ctx, uint32 data_type, REGV
       case REG_SZ:
          data->reg_sz = cac_unistr_to_str(mem_ctx, buf.buffer, buf.buf_len);
          if(!data->reg_sz) {
-            talloc_free(data);
+            TALLOC_FREE(data);
             errno = ENOMEM;
             data = NULL;
          }
@@ -237,7 +237,7 @@ REG_VALUE_DATA *cac_MakeRegValueData(TALLOC_CTX *mem_ctx, uint32 data_type, REGV
          data->reg_expand_sz = cac_unistr_to_str(mem_ctx, buf.buffer, buf.buf_len);
 
          if(!data->reg_expand_sz) {
-            talloc_free(data);
+            TALLOC_FREE(data);
             errno = ENOMEM;
             data = NULL;
          }
@@ -251,7 +251,7 @@ REG_VALUE_DATA *cac_MakeRegValueData(TALLOC_CTX *mem_ctx, uint32 data_type, REGV
 
          data->reg_binary.data = talloc_memdup(mem_ctx, buf.buffer, size);
          if(!data->reg_binary.data) {
-            talloc_free(data);
+            TALLOC_FREE(data);
             errno = ENOMEM;
             data = NULL;
          }
@@ -281,7 +281,7 @@ REG_VALUE_DATA *cac_MakeRegValueData(TALLOC_CTX *mem_ctx, uint32 data_type, REGV
          strings = talloc_array(mem_ctx, char *, num_strings);
          if(!strings) {
             errno = ENOMEM;
-            talloc_free(data);
+            TALLOC_FREE(data);
             break;
          }
 
@@ -313,7 +313,7 @@ REG_VALUE_DATA *cac_MakeRegValueData(TALLOC_CTX *mem_ctx, uint32 data_type, REGV
          break;
 
       default:
-         talloc_free(data);
+         TALLOC_FREE(data);
          data = NULL;
    }
 
index 649cd8b372bbf89f550ca95623b6ebe15b5f499e..7cbe4a639b5e571d2404fc08b38c8af24f89fb65 100644 (file)
@@ -2469,7 +2469,7 @@ done:
         cli_rpc_pipe_close(pipe_hnd);
 
         /* Free all memory which was allocated for this request */
-        talloc_free(mem_ctx);
+        TALLOC_FREE(mem_ctx);
 
         /* Tell 'em if it worked */
         return W_ERROR_IS_OK(result) ? 0 : -1;
index 42ed0f94184851157b717d0a3b3e5ebabfb3cae9..10921d56e7164a57c18fb3ce556f5db41792b4ce 100644 (file)
@@ -339,7 +339,7 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
        debug_ntlmssp_flags(ntlmssp_state->neg_flags);
 
        if (ntlmssp_state->session_key.length < 8) {
-               talloc_free(mem_ctx);
+               TALLOC_FREE(mem_ctx);
                DEBUG(3, ("NO session key, cannot intialise signing\n"));
                return NT_STATUS_NO_USER_SESSION_KEY;
        }
@@ -365,7 +365,7 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
                        recv_seal_const = CLI_SEAL;
                        break;
                default:
-                       talloc_free(mem_ctx);
+                       TALLOC_FREE(mem_ctx);
                        return NT_STATUS_INTERNAL_ERROR;
                }
 
@@ -464,6 +464,6 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
                ntlmssp_state->ntlmv1_seq_num = 0;
        }
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return NT_STATUS_OK;
 }
index d157c30c8221d3dc1ee1c20d78447359bc5c2efd..076f8a496972140ba6e9ce6dc3b33cb49bc23bfe 100644 (file)
@@ -681,7 +681,7 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
 
        if (tdb_chainlock(tdb, key) != 0) {
                DEBUG(3, ("Could not lock share entry\n"));
-               talloc_free(lck);
+               TALLOC_FREE(lck);
                return NULL;
        }
 
@@ -697,20 +697,20 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
        if (lck->fresh) {
 
                if (fname == NULL || servicepath == NULL) {
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        return NULL;
                }
                lck->filename = talloc_strdup(lck, fname);
                lck->servicepath = talloc_strdup(lck, servicepath);
                if (lck->filename == NULL || lck->servicepath == NULL) {
                        DEBUG(0, ("talloc failed\n"));
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        return NULL;
                }
        } else {
                if (!parse_share_modes(data, lck)) {
                        DEBUG(0, ("Could not parse share modes\n"));
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        SAFE_FREE(data.dptr);
                        return NULL;
                }
@@ -814,7 +814,7 @@ BOOL get_delete_on_close_flag(SMB_DEV_T dev, SMB_INO_T inode)
                return False;
        }
        result = lck->delete_on_close;
-       talloc_free(lck);
+       TALLOC_FREE(lck);
        return result;
 }
 
@@ -1142,7 +1142,7 @@ void set_delete_on_close_token(struct share_mode_lock *lck, UNIX_USER_TOKEN *tok
 {
        /* Ensure there's no token. */
        if (lck->delete_token) {
-               talloc_free(lck->delete_token); /* Also deletes groups... */
+               TALLOC_FREE(lck->delete_token); /* Also deletes groups... */
                lck->delete_token = NULL;
        }
 
@@ -1195,7 +1195,7 @@ BOOL set_delete_on_close(files_struct *fsp, BOOL delete_on_close, UNIX_USER_TOKE
                lck->modified = True;
        }
 
-       talloc_free(lck);
+       TALLOC_FREE(lck);
        return True;
 }
 
index f69cc32ff60d4b548f99b3c931f7f930750975fb..38183159a2b9d0ffffe7050147a4892117019a6d 100644 (file)
@@ -607,7 +607,7 @@ static void process(void)
                        return;
 
                /* free up temp memory */
-                       lp_talloc_free();
+                       lp_TALLOC_FREE();
        }
 }
 
index 4a269bac17ae1dba4c1de01998b993a82521dec2..8314c65c643981e5cd19aa24b12cd5586c5b0ec2 100644 (file)
@@ -692,7 +692,7 @@ static void remove_client(struct winbindd_cli_state *state)
                /* Remove from list and free */
                
                winbindd_remove_client(state);
-               talloc_free(state);
+               TALLOC_FREE(state);
        }
 }
 
@@ -751,8 +751,8 @@ static void process_loop(void)
 
        /* Free up temporary memory */
 
-       lp_talloc_free();
-       main_loop_talloc_free();
+       lp_TALLOC_FREE();
+       main_loop_TALLOC_FREE();
 
        /* Initialise fd lists for select() */
 
index a8aab04031abac06d53408e361e1a25d2b152c88..991718fb26a67eaa16b2941da5115acad4cb9f3e 100644 (file)
@@ -73,8 +73,9 @@ NTSTATUS remove_ccache_by_ccname(const char *ccname)
        for (entry = ccache_list; entry; entry = entry->next) {
                if (strequal(entry->ccname, ccname)) {
                        DLIST_REMOVE(ccache_list, entry);
-                       talloc_free(entry->event); /* unregisters events */
-                       return talloc_free(entry) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+                       TALLOC_FREE(entry->event); /* unregisters events */
+                       TALLOC_FREE(entry);
+                       return NT_STATUS_OK;
                }
        }
        return NT_STATUS_OBJECT_NAME_NOT_FOUND;
@@ -94,7 +95,7 @@ static void krb5_ticket_refresh_handler(struct timed_event *te,
        DEBUG(10,("krb5_ticket_refresh_handler called\n"));
        DEBUGADD(10,("event called for: %s, %s\n", entry->ccname, entry->username));
 
-       talloc_free(entry->event);
+       TALLOC_FREE(entry->event);
 
 #ifdef HAVE_KRB5
 
@@ -117,7 +118,7 @@ static void krb5_ticket_refresh_handler(struct timed_event *te,
 
                if (ret) {
                        DEBUG(3,("could not re-kinit: %s\n", error_message(ret)));
-                       talloc_free(entry->event);
+                       TALLOC_FREE(entry->event);
                        return;
                }
 
index 56a7afec9fea4e8b2a15641d5219e501ef987c37..7864254c4656c6db77c71034c0596314928319ce 100644 (file)
@@ -509,7 +509,7 @@ static void account_lockout_policy_handler(struct timed_event *te,
        DEBUG(10,("account_lockout_policy_handler called\n"));
 
        if (child->timed_event) {
-               talloc_free(child->timed_event);
+               TALLOC_FREE(child->timed_event);
        }
 
        methods = child->domain->methods;
@@ -675,8 +675,8 @@ static BOOL fork_domain_child(struct winbindd_child *child)
                struct timeval now;
 
                /* free up any talloc memory */
-               lp_talloc_free();
-               main_loop_talloc_free();
+               lp_TALLOC_FREE();
+               main_loop_TALLOC_FREE();
 
                run_events();
 
index 736d852a74e2a0950b243e7a9cb6628a0febe60d..cd0214ff45188ffec8637e6565764fd653e3ce8e 100644 (file)
@@ -445,8 +445,8 @@ static void process_ldap_loop(void)
 
        /* Free up temporary memory */
 
-       lp_talloc_free();
-       main_loop_talloc_free();
+       lp_TALLOC_FREE();
+       main_loop_TALLOC_FREE();
 
        if (do_sigterm) {
 #if 0
index 47b8d7bbd597a39493c3ac72f7de0b34fa006e40..3f0b7f07aaa3737afe42c9529dd530fa7dc16c4d 100644 (file)
@@ -1265,7 +1265,7 @@ done:
                                strlen(state->response.extra_data)+1;
 
        no_token:
-               talloc_free(afsname);
+               TALLOC_FREE(afsname);
        }
 
        return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR;
index c1cac6b966866f9c855fc7d7cdee2871ff06b488..b44fcfbd91f12a3bad107309bcc23226b79733c9 100644 (file)
@@ -1665,11 +1665,11 @@ static TALLOC_CTX *lp_talloc;
  Free up temporary memory - called from the main loop.
 ********************************************************************/
 
-void lp_talloc_free(void)
+void lp_TALLOC_FREE(void)
 {
        if (!lp_talloc)
                return;
-       talloc_free(lp_talloc);
+       TALLOC_FREE(lp_talloc);
        lp_talloc = NULL;
 }
 
index 6266aa9cab72bcd017a6557d0737de32da160ca4..f6eb1e7baa1c344690f732e160177e0f530390cc 100644 (file)
@@ -265,13 +265,13 @@ BOOL lookup_name(TALLOC_CTX *mem_ctx,
        }
 
  failed:
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(tmp_ctx);
        return False;
 
  ok:
        if ((domain == NULL) || (name == NULL)) {
                DEBUG(0, ("talloc failed\n"));
-               talloc_free(tmp_ctx);
+               TALLOC_FREE(tmp_ctx);
                return False;
        }
 
@@ -293,7 +293,7 @@ BOOL lookup_name(TALLOC_CTX *mem_ctx,
                *ret_type = type;
        }
 
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(tmp_ctx);
        return True;
 }
 
@@ -746,7 +746,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
        result = NT_STATUS_OK;
 
  done:
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(tmp_ctx);
        return result;
 }
 
@@ -802,7 +802,7 @@ BOOL lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
                DEBUG(10, ("failed to lookup sid %s\n",
                           sid_string_static(sid)));
        }
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(tmp_ctx);
        return ret;
 }
 
index a50afb6bb869e040aef93a6a8dce8335b786a5eb..97cccbf2a52679c71714f10006e3dde92391633e 100644 (file)
@@ -484,7 +484,7 @@ NTSTATUS pdb_init_sam_new(SAM_ACCOUNT **new_sam_acct, const char *username)
                pdb_free_sam(new_sam_acct);
        }
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
index f42ff3a72539e2e44da4f6ea4d8061f297a02eea..e2035296cca6cd1186964f5746ffac6baff58348 100644 (file)
@@ -1380,7 +1380,7 @@ static BOOL pdb_default_sid_to_id(struct pdb_methods *methods,
 
  done:
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return ret;
 }
 
@@ -1531,7 +1531,7 @@ NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods,
        *pp_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, *p_num_groups);
 
        if (*pp_sids == NULL) {
-               talloc_free(*pp_gids);
+               TALLOC_FREE(*pp_gids);
                return NT_STATUS_NO_MEMORY;
        }
 
index 24a7304f8739089b9b7b6e1a69be2602cf39d71c..9abd668d6f4c5c244cac6ba9567ad3038f215d80 100644 (file)
@@ -1353,7 +1353,7 @@ static NTSTATUS ldapsam_setsampwent(struct pdb_methods *my_methods, BOOL update,
        attr_list = get_userattr_list(NULL, ldap_state->schema_ver);
        rc = smbldap_search(ldap_state->smbldap_state, suffix, LDAP_SCOPE_SUBTREE, filter, 
                            attr_list, 0, &ldap_state->result);
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
 
        if (rc != LDAP_SUCCESS) {
                DEBUG(0, ("ldapsam_setsampwent: LDAP search failed: %s\n", ldap_err2string(rc)));
@@ -1454,7 +1454,7 @@ static NTSTATUS ldapsam_getsampwnam(struct pdb_methods *my_methods, SAM_ACCOUNT
        append_attr(user->mem_ctx, &attr_list, "uidNumber");
        rc = ldapsam_search_suffix_by_name(ldap_state, sname, &result,
                                           attr_list);
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
 
        if ( rc != LDAP_SUCCESS ) 
                return NT_STATUS_NO_SUCH_USER;
@@ -1511,7 +1511,7 @@ static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state,
                        append_attr(tmp_ctx, &attr_list, "uidNumber");
                        rc = ldapsam_search_suffix_by_sid(ldap_state, sid,
                                                          result, attr_list);
-                       talloc_free(tmp_ctx);
+                       TALLOC_FREE(tmp_ctx);
 
                        if ( rc != LDAP_SUCCESS ) 
                                return rc;
@@ -1526,7 +1526,7 @@ static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state,
                        attr_list = get_userattr_list(NULL,
                                                      ldap_state->schema_ver);
                        rc = ldapsam_search_suffix_by_rid(ldap_state, rid, result, attr_list );
-                       talloc_free( attr_list );
+                       TALLOC_FREE( attr_list );
 
                        if ( rc != LDAP_SUCCESS ) 
                                return rc;
@@ -1783,7 +1783,7 @@ static NTSTATUS ldapsam_delete_sam_account(struct pdb_methods *my_methods,
                NT_STATUS_OK : NT_STATUS_ACCESS_DENIED;
 
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
@@ -1817,7 +1817,7 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A
        if (!result) {
                attr_list = get_userattr_list(NULL, ldap_state->schema_ver);
                rc = ldapsam_search_suffix_by_name(ldap_state, pdb_get_username(newpwd), &result, attr_list );
-               talloc_free( attr_list );
+               TALLOC_FREE( attr_list );
                if (rc != LDAP_SUCCESS) {
                        return NT_STATUS_UNSUCCESSFUL;
                }
@@ -1959,7 +1959,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
        rc = ldapsam_search_suffix_by_name (ldap_state, username, &result, attr_list);
 
        if (rc != LDAP_SUCCESS) {
-               talloc_free( attr_list );
+               TALLOC_FREE( attr_list );
                return NT_STATUS_UNSUCCESSFUL;
        }
 
@@ -1967,7 +1967,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                DEBUG(0,("ldapsam_add_sam_account: User '%s' already in the base, with samba attributes\n", 
                         username));
                ldap_msgfree(result);
-               talloc_free( attr_list );
+               TALLOC_FREE( attr_list );
                return NT_STATUS_UNSUCCESSFUL;
        }
        ldap_msgfree(result);
@@ -1980,7 +1980,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                        if (ldap_count_entries(ldap_state->smbldap_state->ldap_struct, result) != 0) {
                                DEBUG(0,("ldapsam_add_sam_account: SID '%s' already in the base, with samba attributes\n", 
                                         sid_to_string(sid_string, sid)));
-                               talloc_free( attr_list );
+                               TALLOC_FREE( attr_list );
                                ldap_msgfree(result);
                                return NT_STATUS_UNSUCCESSFUL;
                        }
@@ -1999,7 +1999,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
        rc = smbldap_search_suffix(ldap_state->smbldap_state, 
                                   filter, attr_list, &result);
        if ( rc != LDAP_SUCCESS ) {
-               talloc_free( attr_list );
+               TALLOC_FREE( attr_list );
                return NT_STATUS_UNSUCCESSFUL;
        }
 
@@ -2007,7 +2007,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
        
        if (num_result > 1) {
                DEBUG (0, ("ldapsam_add_sam_account: More than one user with that uid exists: bailing out!\n"));
-               talloc_free( attr_list );
+               TALLOC_FREE( attr_list );
                ldap_msgfree(result);
                return NT_STATUS_UNSUCCESSFUL;
        }
@@ -2021,7 +2021,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                entry = ldap_first_entry (ldap_state->smbldap_state->ldap_struct, result);
                tmp = smbldap_get_dn (ldap_state->smbldap_state->ldap_struct, entry);
                if (!tmp) {
-                       talloc_free( attr_list );
+                       TALLOC_FREE( attr_list );
                        ldap_msgfree(result);
                        return NT_STATUS_UNSUCCESSFUL;
                }
@@ -2047,7 +2047,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                                           filter, attr_list, &result);
                        
                if ( rc != LDAP_SUCCESS ) {
-                       talloc_free( attr_list );
+                       TALLOC_FREE( attr_list );
                        return NT_STATUS_UNSUCCESSFUL;
                }
                
@@ -2055,7 +2055,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                
                if (num_result > 1) {
                        DEBUG (0, ("ldapsam_add_sam_account: More than one user with that uid exists: bailing out!\n"));
-                       talloc_free( attr_list );
+                       TALLOC_FREE( attr_list );
                        ldap_msgfree(result);
                        return NT_STATUS_UNSUCCESSFUL;
                }
@@ -2069,7 +2069,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                        entry = ldap_first_entry (ldap_state->smbldap_state->ldap_struct, result);
                        tmp = smbldap_get_dn (ldap_state->smbldap_state->ldap_struct, entry);
                        if (!tmp) {
-                               talloc_free( attr_list );
+                               TALLOC_FREE( attr_list );
                                ldap_msgfree(result);
                                return NT_STATUS_UNSUCCESSFUL;
                        }
@@ -2078,7 +2078,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO
                }
        }
        
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
 
        if (num_result == 0) {
                /* Check if we need to add an entry */
@@ -2147,7 +2147,7 @@ static int ldapsam_search_one_group (struct ldapsam_privates *ldap_state,
        rc = smbldap_search(ldap_state->smbldap_state, 
                            lp_ldap_group_suffix (), scope,
                            filter, attr_list, 0, result);
-       talloc_free(attr_list);
+       TALLOC_FREE(attr_list);
 
        return rc;
 }
@@ -2862,7 +2862,7 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods,
                NT_STATUS_OK : NT_STATUS_ACCESS_DENIED;
 
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
@@ -2950,7 +2950,7 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods,
        result = NT_STATUS_OK;
 
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
@@ -3029,7 +3029,7 @@ static NTSTATUS ldapsam_delete_group_mapping_entry(struct pdb_methods *methods,
        result = (rc == LDAP_SUCCESS) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
 
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
  }
 
@@ -3050,7 +3050,7 @@ static NTSTATUS ldapsam_setsamgrent(struct pdb_methods *my_methods,
        rc = smbldap_search(ldap_state->smbldap_state, lp_ldap_group_suffix(),
                            LDAP_SCOPE_SUBTREE, filter,
                            attr_list, 0, &ldap_state->result);
-       talloc_free(attr_list);
+       TALLOC_FREE(attr_list);
 
        if (rc != LDAP_SUCCESS) {
                DEBUG(0, ("ldapsam_setsamgrent: LDAP search failed: %s\n",
@@ -3871,7 +3871,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
                result = (num_mapped == num_rids) ?
                        NT_STATUS_OK : STATUS_SOME_UNMAPPED;
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
@@ -4495,7 +4495,7 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
                *rid = nextRid;
        }
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return status;
 }
 
@@ -4605,7 +4605,7 @@ static BOOL ldapsam_sid_to_id(struct pdb_methods *methods,
 
        ret = True;
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return ret;
 }
 
index d5636d68125ea16d02ea520bee15090466f62417..4bbdeb4dbb7e9bb7154bb80ff617d04d2b8145c1 100644 (file)
@@ -774,7 +774,7 @@ static NTSTATUS pdb_nds_update_login_attempts(struct pdb_methods *methods,
                        attr_list = get_userattr_list(NULL,
                                                      ldap_state->schema_ver);
                        rc = ldapsam_search_suffix_by_name(ldap_state, username, &result, attr_list );
-                       talloc_free( attr_list );
+                       TALLOC_FREE( attr_list );
                        if (rc != LDAP_SUCCESS) {
                                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
                        }
index 7839860bf4392720ac9fd7de40aaf189d7c0c962..1837b4fcee5df0110cc174199a7713d34077aae7 100644 (file)
@@ -1161,7 +1161,7 @@ static BOOL build_smb_pass (struct smb_passwd *smb_pw, const SAM_ACCOUNT *sampas
                                return False;
                        }
                        smb_pw->smb_userid=passwd->pw_uid;
-                       talloc_free(passwd);
+                       TALLOC_FREE(passwd);
                } else if (algorithmic_pdb_rid_is_user(rid)) {
                        smb_pw->smb_userid=algorithmic_pdb_user_rid_to_uid(rid);
                } else {
@@ -1206,7 +1206,7 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state,
        if (!NT_STATUS_IS_OK(pdb_fill_sam_pw(sam_pass, pwfile)))
                return False;
                
-       talloc_free(pwfile);
+       TALLOC_FREE(pwfile);
 
        /* set remaining fields */
                
index ece17cc718da623ca63bdd64321ee453832366dd..bb4aad9fac6b6c44f5586422af044c689e69bed9 100644 (file)
@@ -892,7 +892,7 @@ static TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx)
 
         if (!tdb_sc) {
                 DEBUG(0,("open_schannel_session_store: Failed to open %s\n", fname));
-               talloc_free(fname);
+               TALLOC_FREE(fname);
                 return NULL;
         }
 
@@ -920,7 +920,7 @@ static TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx)
        }
 
        SAFE_FREE(vers.dptr);
-       talloc_free(fname);
+       TALLOC_FREE(fname);
 
        return tdb_sc;
 }
@@ -959,7 +959,7 @@ BOOL secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx,
 
        value.dptr = TALLOC(mem_ctx, value.dsize);
        if (!value.dptr) {
-               talloc_free(keystr);
+               TALLOC_FREE(keystr);
                return False;
        }
 
@@ -976,8 +976,8 @@ BOOL secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx,
 
        tdb_sc = open_schannel_session_store(mem_ctx);
        if (!tdb_sc) {
-               talloc_free(keystr);
-               talloc_free(value.dptr);
+               TALLOC_FREE(keystr);
+               TALLOC_FREE(value.dptr);
                return False;
        }
 
@@ -987,8 +987,8 @@ BOOL secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx,
                keystr ));
 
        tdb_close(tdb_sc);
-       talloc_free(keystr);
-       talloc_free(value.dptr);
+       TALLOC_FREE(keystr);
+       TALLOC_FREE(value.dptr);
        return ret;
 }
 
@@ -1024,7 +1024,7 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx,
 
        tdb_sc = open_schannel_session_store(mem_ctx);
        if (!tdb_sc) {
-               talloc_free(keystr);
+               TALLOC_FREE(keystr);
                return False;
        }
 
@@ -1055,8 +1055,8 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx,
        if (ret == -1 || l1 != 8 || l2 != 8 || l3 != 8 || l4 != 16 || l5 != 16) {
                /* Bad record - delete it. */
                tdb_delete_bystring(tdb_sc, keystr);
-               talloc_free(keystr);
-               talloc_free(pdc);
+               TALLOC_FREE(keystr);
+               TALLOC_FREE(pdc);
                SAFE_FREE(pseed_chal);
                SAFE_FREE(pclnt_chal);
                SAFE_FREE(psrv_chal);
@@ -1085,7 +1085,7 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx,
        SAFE_FREE(psess_key);
        SAFE_FREE(pmach_pw);
 
-       talloc_free(keystr);
+       TALLOC_FREE(keystr);
        SAFE_FREE(value.dptr);
 
        *ppdc = pdc;
index ee8cf2d8f0275e62b295da9e0dc5244ed698adc2..2a4818e3aec95f0ccc5c108b7ec2970e039d5d65 100644 (file)
@@ -53,7 +53,7 @@ BOOL lookup_unix_user_name(const char *name, DOM_SID *sid)
        sid_copy(sid, &global_sid_Unix_Users);
        sid_append_rid(sid, pwd->pw_uid); /* For 64-bit uid's we have enough
                                          * space ... */
-       talloc_free(pwd);
+       TALLOC_FREE(pwd);
        return True;
 }
 
index bc1eda8d04dee9eb904c500984d947e911d5167d..5973deefd0566b2469e469668b82e4df01e35ead 100644 (file)
@@ -49,7 +49,7 @@ static TALLOC_CTX *main_loop_talloc = NULL;
 free up temporary memory - called from the main loop
 ********************************************************************/
 
-void main_loop_talloc_free(void)
+void main_loop_TALLOC_FREE(void)
 {
     if (!main_loop_talloc)
         return;
index e762a8b9e2b45eeda636be23bbdb92fe90438559..737729a4cebb927dcdeefc2182dc920f3ecd247a 100644 (file)
@@ -888,7 +888,7 @@ static NTSTATUS _net_sam_logon_internal(pipes_struct *p,
                     && !is_trusted_domain(nt_domain) )
                        r_u->auth_resp = 0; /* We are not authoritative */
 
-               talloc_free(server_info);
+               TALLOC_FREE(server_info);
                return status;
        }
 
@@ -896,7 +896,7 @@ static NTSTATUS _net_sam_logon_internal(pipes_struct *p,
                /* We don't like guest domain logons... */
                DEBUG(5,("_net_sam_logon: Attempted domain logon as GUEST "
                         "denied.\n"));
-               talloc_free(server_info);
+               TALLOC_FREE(server_info);
                return NT_STATUS_LOGON_FAILURE;
        }
 
@@ -1025,7 +1025,7 @@ static NTSTATUS _net_sam_logon_internal(pipes_struct *p,
                ZERO_STRUCT(user_session_key);
                ZERO_STRUCT(lm_session_key);
        }
-       talloc_free(server_info);
+       TALLOC_FREE(server_info);
        return status;
 }
 
index 3ed33ca691130025f7f1dfe6179ac2583a25411c..67fb89ef790cc41ff3c57c9a7a6511d0dae14d39 100644 (file)
@@ -616,7 +616,7 @@ static BOOL pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob)
        memset(p->wks, '\0', sizeof(p->wks));
 
        /* Set up for non-authenticated user. */
-       talloc_free(p->pipe_user.nt_user_token);
+       TALLOC_FREE(p->pipe_user.nt_user_token);
        p->pipe_user.ut.ngroups = 0;
        SAFE_FREE( p->pipe_user.ut.groups);
 
@@ -1309,7 +1309,7 @@ static BOOL pipe_schannel_auth_bind(pipes_struct *p, prs_struct *rpc_in_p,
 
        p->auth.a_u.schannel_auth = TALLOC_P(p->pipe_state_mem_ctx, struct schannel_auth_struct);
        if (!p->auth.a_u.schannel_auth) {
-               talloc_free(pdcinfo);
+               TALLOC_FREE(pdcinfo);
                return False;
        }
 
@@ -1317,7 +1317,7 @@ static BOOL pipe_schannel_auth_bind(pipes_struct *p, prs_struct *rpc_in_p,
        memcpy(p->auth.a_u.schannel_auth->sess_key, pdcinfo->sess_key,
                        sizeof(pdcinfo->sess_key));
 
-       talloc_free(pdcinfo);
+       TALLOC_FREE(pdcinfo);
 
        p->auth.a_u.schannel_auth->seq_num = 0;
 
index 86a04e7ccbe9602be030f9fb824b52a78c6e3640..f7467f2cf06d35ed7195d58beba280bd1973da2e 100644 (file)
@@ -1223,7 +1223,7 @@ static BOOL close_internal_rpc_pipe_hnd(void *np_conn)
        /* Free the handles database. */
        close_policy_by_pipe(p);
 
-       talloc_free(p->pipe_user.nt_user_token);
+       TALLOC_FREE(p->pipe_user.nt_user_token);
        data_blob_free(&p->session_key);
        SAFE_FREE(p->pipe_user.ut.groups);
 
index afca3e747f2728531ebbb0d0db1ffb1a28932945..137335962eabe60eb3473c3cb1b99fdcadc2f853 100644 (file)
@@ -704,7 +704,7 @@ static void display_reg_value(REGISTRY_VALUE value)
                        }
                        putchar(hex[i]);
                }
-               talloc_free(hex);
+               TALLOC_FREE(hex);
                putchar('\n');
                break;
        }
index 17482a5146d0890b73b0c73bd681af1277064199..6169c89b3b9a9674ba87c953d62a2bd11888bbe4 100644 (file)
@@ -145,7 +145,7 @@ static NTSTATUS ldap_allocate_id(unid_t *id, int id_type)
        rc = smbldap_search(ldap_state.smbldap_state, lp_ldap_idmap_suffix(),
                               LDAP_SCOPE_SUBTREE, filter,
                               attr_list, 0, &result);
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
         
        if (rc != LDAP_SUCCESS) {
                DEBUG(0,("ldap_allocate_id: %s object not found\n", LDAP_OBJ_IDPOOL));
@@ -280,7 +280,7 @@ static NTSTATUS ldap_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type)
 
        ret = NT_STATUS_OK;
 out:
-       talloc_free( attr_list );        
+       TALLOC_FREE( attr_list );        
 
        if (result)
                ldap_msgfree(result);
@@ -397,7 +397,7 @@ static NTSTATUS ldap_get_id_from_sid(unid_t *id, int *id_type, const DOM_SID *si
        }
        
 out:
-       talloc_free( attr_list );
+       TALLOC_FREE( attr_list );
        if (result)
                ldap_msgfree(result);
        SAFE_FREE(dn);
@@ -423,7 +423,7 @@ static NTSTATUS verify_idpool( void )
        attr_list = get_attr_list( NULL, idpool_attr_list );
        rc = smbldap_search(ldap_state.smbldap_state, lp_ldap_idmap_suffix(), 
                LDAP_SCOPE_SUBTREE, filter, attr_list, 0, &result);
-       talloc_free ( attr_list );
+       TALLOC_FREE( attr_list );
 
        if (rc != LDAP_SUCCESS)
                return NT_STATUS_UNSUCCESSFUL;
index 059b88ecc898cc4a54a3e975003fa0fdb57f97e9..09276cd200dc81a7bbd689e9642e9d5368d8caeb 100644 (file)
@@ -288,7 +288,7 @@ static int close_normal_file(files_struct *fsp, enum file_close_type close_type)
                process_pending_change_notify_queue((time_t)0);
        }
 
-       talloc_free(lck);
+       TALLOC_FREE(lck);
 
        if(fsp->oplock_type)
                release_file_oplock(fsp);
@@ -363,7 +363,7 @@ static int close_directory(files_struct *fsp, enum file_close_type close_type)
 
        delete_dir = (lck->delete_on_close | lck->initial_delete_on_close);
 
-       talloc_free(lck);
+       TALLOC_FREE(lck);
 
        if ((close_type == NORMAL_CLOSE || close_type == SHUTDOWN_CLOSE) &&
                                delete_dir &&
index bf4db99ea659434fab42f34ea2309d8b07b45155..b41467f02c7514706903df5776b4ade436476550 100644 (file)
@@ -249,7 +249,7 @@ void conn_free_internal(connection_struct *conn)
        }
 
        if (conn->nt_user_token) {
-               talloc_free(conn->nt_user_token);
+               TALLOC_FREE(conn->nt_user_token);
        }
 
        free_namearray(conn->veto_list);
index a2ec6f34b8b5f0630ccb52db6dab81f94bd3bc52..3f10ba41b27afd5b764ac78b2b5f432bc3b97e6a 100644 (file)
@@ -2026,7 +2026,7 @@ static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid, char *para
 done:
        unbecome_root();                                /* END ROOT BLOCK */
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
 
        return ret;
 }
@@ -2219,7 +2219,7 @@ static BOOL api_SetUserPassword(connection_struct *conn,uint16 vuid, char *param
                        }
                        unbecome_root();
 
-                       talloc_free(server_info);
+                       TALLOC_FREE(server_info);
                }
                data_blob_clear_free(&password);
        }
index 3e555a8f31f2ba9f148694ac10434103e1a68919..258e0e6021563dd3956daa3b522087610535197c 100644 (file)
@@ -1352,7 +1352,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
                                           &state);
                        }
 
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        return NULL;
                }
 
@@ -1363,7 +1363,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
                if (NT_STATUS_EQUAL(status, NT_STATUS_DELETE_PENDING)) {
                        /* DELETE_PENDING is not deferred for a second */
                        set_saved_ntstatus(status);
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        file_free(fsp);
                        return NULL;
                }
@@ -1384,7 +1384,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
                                                          create_options);
 
                                if (fsp_dup) {
-                                       talloc_free(lck);
+                                       TALLOC_FREE(lck);
                                        file_free(fsp);
                                        if (pinfo) {
                                                *pinfo = FILE_WAS_OPENED;
@@ -1447,7 +1447,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
                                }
                        }
 
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        if (fsp_open) {
                                fd_close(conn, fsp);
                                /*
@@ -1490,7 +1490,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
 
        if (!fsp_open) {
                if (lck != NULL) {
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                }
                file_free(fsp);
                return NULL;
@@ -1551,7 +1551,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
 
                        defer_open(lck, request_time, timeval_zero(),
                                   &state);
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        return NULL;
                }
 
@@ -1588,7 +1588,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
                 */
                if ((SMB_VFS_FTRUNCATE(fsp,fsp->fh->fd,0) == -1) ||
                    (SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf)==-1)) {
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        fd_close(conn,fsp);
                        file_free(fsp);
                        return NULL;
@@ -1643,7 +1643,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
                        if (!NT_STATUS_IS_OK(result)) {
                                /* Remember to delete the mode we just added. */
                                del_share_mode(lck, fsp);
-                               talloc_free(lck);
+                               TALLOC_FREE(lck);
                                fd_close(conn,fsp);
                                file_free(fsp);
                                set_saved_ntstatus(result);
@@ -1712,7 +1712,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
        /* If this is a successful open, we must remove any deferred open
         * records. */
        del_deferred_open_entry(lck, mid);
-       talloc_free(lck);
+       TALLOC_FREE(lck);
 
        conn->num_files_open++;
 
@@ -1933,7 +1933,7 @@ files_struct *open_directory(connection_struct *conn,
 
        if (!NT_STATUS_IS_OK(status)) {
                set_saved_ntstatus(status);
-               talloc_free(lck);
+               TALLOC_FREE(lck);
                file_free(fsp);
                return NULL;
        }
@@ -1946,7 +1946,7 @@ files_struct *open_directory(connection_struct *conn,
                status = can_set_delete_on_close(fsp, True, 0);
                if (!NT_STATUS_IS_OK(status)) {
                        set_saved_ntstatus(status);
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        file_free(fsp);
                        return NULL;
                }
@@ -1956,7 +1956,7 @@ files_struct *open_directory(connection_struct *conn,
                lck->modified = True;
        }
 
-       talloc_free(lck);
+       TALLOC_FREE(lck);
 
        /* Change the owner if required. */
        if ((info == FILE_WAS_CREATED) && lp_inherit_owner(SNUM(conn))) {
index 3efd63064908f5bd60ce46941cdab8ce57c22159..7d0a94efda02f1090be85dd9500609033b9af7ab 100644 (file)
@@ -197,7 +197,7 @@ BOOL remove_oplock(files_struct *fsp)
                         (double)inode));
        }
        release_file_oplock(fsp);
-       talloc_free(lck);
+       TALLOC_FREE(lck);
        return ret;
 }
 
@@ -226,7 +226,7 @@ BOOL downgrade_oplock(files_struct *fsp)
        }
 
        downgrade_file_oplock(fsp);
-       talloc_free(lck);
+       TALLOC_FREE(lck);
        return ret;
 }
 
@@ -470,7 +470,7 @@ static void process_oplock_async_level2_break_message(int msg_type, struct proce
        /* Restore the sign state to what it was. */
        srv_oplock_set_signing(sign_state);
 
-       talloc_free(break_msg);
+       TALLOC_FREE(break_msg);
 
        /* Async level2 request, don't send a reply, just remove the oplock. */
        remove_oplock(fsp);
@@ -578,7 +578,7 @@ static void process_oplock_break_message(int msg_type, struct process_id src,
        /* Restore the sign state to what it was. */
        srv_oplock_set_signing(sign_state);
 
-       talloc_free(break_msg);
+       TALLOC_FREE(break_msg);
 
        fsp->sent_oplock_break = break_to_level2 ? LEVEL_II_BREAK_SENT:BREAK_TO_NONE_SENT;
 
@@ -654,7 +654,7 @@ static void process_kernel_oplock_break(int msg_type, struct process_id src,
        /* Restore the sign state to what it was. */
        srv_oplock_set_signing(sign_state);
 
-       talloc_free(break_msg);
+       TALLOC_FREE(break_msg);
 
        fsp->sent_oplock_break = BREAK_TO_NONE_SENT;
 
@@ -681,7 +681,7 @@ void reply_to_oplock_break_requests(files_struct *fsp)
        fsp->num_pending_break_messages = 0;
        if (fsp->oplock_timeout != NULL) {
                /* Remove the timed event handler. */
-               talloc_free(fsp->oplock_timeout);
+               TALLOC_FREE(fsp->oplock_timeout);
                fsp->oplock_timeout = NULL;
        }
        return;
@@ -801,7 +801,7 @@ void release_level_2_oplocks_on_change(files_struct *fsp)
                        DEBUG(0,("release_level_2_oplocks_on_change: PANIC. "
                                 "share mode entry %d is an exlusive "
                                 "oplock !\n", i ));
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        abort();
                }
 
@@ -816,7 +816,7 @@ void release_level_2_oplocks_on_change(files_struct *fsp)
        /* We let the message receivers handle removing the oplock state
           in the share mode lock db. */
 
-       talloc_free(lck);
+       TALLOC_FREE(lck);
 }
 
 /****************************************************************************
index 0eeb537ded74851e9a765ce9f95b0417fc6e4974..782a8c2b8963b79ae2b5adbb1841cfdb86ce0f96 100644 (file)
@@ -100,7 +100,7 @@ void invalidate_vuid(uint16 vuid)
        session_yield(vuser);
        SAFE_FREE(vuser->session_keystr);
 
-       talloc_free(vuser->server_info);
+       TALLOC_FREE(vuser->server_info);
 
        data_blob_free(&vuser->session_key);
 
@@ -111,7 +111,7 @@ void invalidate_vuid(uint16 vuid)
        conn_clear_vuid_cache(vuid);
 
        SAFE_FREE(vuser->groups);
-       talloc_free(vuser->nt_user_token);
+       TALLOC_FREE(vuser->nt_user_token);
        SAFE_FREE(vuser);
        num_validated_vuids--;
 }
@@ -215,7 +215,7 @@ int register_vuid(auth_serversupplied_info *server_info,
                                 "vuser->groups\n"));
                        data_blob_free(&session_key);
                        free(vuser);
-                       talloc_free(server_info);
+                       TALLOC_FREE(server_info);
                        return UID_FIELD_INVALID;
                }
        }
@@ -252,7 +252,7 @@ int register_vuid(auth_serversupplied_info *server_info,
                        if (passwd) {
                                vuser->unix_homedir =
                                        smb_xstrdup(passwd->pw_dir);
-                               talloc_free(passwd);
+                               TALLOC_FREE(passwd);
                        }
                }
                
@@ -280,7 +280,7 @@ int register_vuid(auth_serversupplied_info *server_info,
        } else {
                DEBUG(1, ("server_info does not contain a user_token - "
                          "cannot continue\n"));
-               talloc_free(server_info);
+               TALLOC_FREE(server_info);
                data_blob_free(&session_key);
                SAFE_FREE(vuser->homedir);
                SAFE_FREE(vuser->unix_homedir);
index 9d35252e28b58bd564bafa4c4884017ac9d0f72f..a50323887a695ad0d8b881d0963ca9d0a1ec89d0 100644 (file)
@@ -91,7 +91,7 @@ static BOOL push_queued_message(char *buf, int msg_len,
        msg->buf = data_blob_talloc(msg, buf, msg_len);
        if(msg->buf.data == NULL) {
                DEBUG(0,("push_message: malloc fail (2)\n"));
-               talloc_free(msg);
+               TALLOC_FREE(msg);
                return False;
        }
 
@@ -103,7 +103,7 @@ static BOOL push_queued_message(char *buf, int msg_len,
                                                     private_len);
                if (msg->private_data.data == NULL) {
                        DEBUG(0,("push_message: malloc fail (3)\n"));
-                       talloc_free(msg);
+                       TALLOC_FREE(msg);
                        return False;
                }
        }
@@ -131,7 +131,7 @@ void remove_deferred_open_smb_message(uint16 mid)
                                  (unsigned int)mid,
                                  (unsigned int)pml->buf.length ));
                        DLIST_REMOVE(deferred_open_queue, pml);
-                       talloc_free(pml);
+                       TALLOC_FREE(pml);
                        return;
                }
        }
@@ -237,11 +237,11 @@ static void idle_event_handler(struct timed_event *te,
        struct idle_event *event =
                talloc_get_type_abort(private_data, struct idle_event);
 
-       talloc_free(event->te);
+       TALLOC_FREE(event->te);
 
        if (!event->handler(now, event->private_data)) {
                /* Don't repeat, delete ourselves */
-               talloc_free(event);
+               TALLOC_FREE(event);
                return;
        }
 
@@ -277,7 +277,7 @@ struct idle_event *add_idle_event(TALLOC_CTX *mem_ctx,
                                     idle_event_handler, result);
        if (result->te == NULL) {
                DEBUG(0, ("add_timed_event failed\n"));
-               talloc_free(result);
+               TALLOC_FREE(result);
                return NULL;
        }
 
@@ -1623,8 +1623,8 @@ void smbd_process(void)
                errno = 0;      
                
                /* free up temporary memory */
-               lp_talloc_free();
-               main_loop_talloc_free();
+               lp_TALLOC_FREE();
+               main_loop_TALLOC_FREE();
 
                /* Did someone ask for immediate checks on things like blocking locks ? */
                if (select_timeout == 0) {
index 89b98be1e77024738ee8acdce2a16503c8fecaf8..1ca9d39a4c7a01ce86cc3f9d765579bbc9d27d67 100644 (file)
@@ -4263,11 +4263,11 @@ NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp, char *
                DEBUG(3,("rename_internals_fsp: succeeded doing rename on %s -> %s\n",
                        fsp->fsp_name,newname));
                rename_open_files(conn, lck, fsp->dev, fsp->inode, newname);
-               talloc_free(lck);
+               TALLOC_FREE(lck);
                return NT_STATUS_OK;    
        }
 
-       talloc_free(lck);
+       TALLOC_FREE(lck);
 
        if (errno == ENOTDIR || errno == EISDIR) {
                error = NT_STATUS_OBJECT_NAME_COLLISION;
@@ -4492,11 +4492,11 @@ directory = %s, newname = %s, last_component_dest = %s, is_8_3 = %d\n",
                        DEBUG(3,("rename_internals: succeeded doing rename on %s -> %s\n",
                                directory,newname));
                        rename_open_files(conn, lck, sbuf1.st_dev, sbuf1.st_ino, newname);
-                       talloc_free(lck);
+                       TALLOC_FREE(lck);
                        return NT_STATUS_OK;    
                }
 
-               talloc_free(lck);
+               TALLOC_FREE(lck);
                if (errno == ENOTDIR || errno == EISDIR)
                        error = NT_STATUS_OBJECT_NAME_COLLISION;
                else
@@ -4599,7 +4599,7 @@ directory = %s, newname = %s, last_component_dest = %s, is_8_3 = %d\n",
                                        count++;
                                        error = NT_STATUS_OK;
                                }
-                               talloc_free(lck);
+                               TALLOC_FREE(lck);
                                DEBUG(3,("rename_internals: doing rename on %s -> %s\n",fname,destname));
                        }
                        CloseDir(dir_hnd);
index ebc47c51d9d07c5271dedf342d4b46dc842c3e9b..a30123bfa7923c413cbc14250540fc127fef6636 100644 (file)
@@ -215,7 +215,7 @@ BOOL push_sec_ctx(void)
        if (ctx_p->ut.ngroups != 0) {
                if (!(ctx_p->ut.groups = SMB_MALLOC_ARRAY(gid_t, ctx_p->ut.ngroups))) {
                        DEBUG(0, ("Out of memory in push_sec_ctx()\n"));
-                       talloc_free(ctx_p->token);
+                       TALLOC_FREE(ctx_p->token);
                        return False;
                }
 
@@ -255,7 +255,7 @@ void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN
        if (token && (token == ctx_p->token))
                smb_panic("DUPLICATE_TOKEN");
 
-       talloc_free(ctx_p->token);
+       TALLOC_FREE(ctx_p->token);
        
        ctx_p->ut.groups = memdup(groups, sizeof(gid_t) * ngroups);
        ctx_p->token = dup_nt_token(NULL, token);
@@ -311,7 +311,7 @@ BOOL pop_sec_ctx(void)
        SAFE_FREE(ctx_p->ut.groups);
        ctx_p->ut.ngroups = 0;
 
-       talloc_free(ctx_p->token);
+       TALLOC_FREE(ctx_p->token);
 
        /* Pop back previous user */
 
index 6c2034988a7f9bab7b851cedcf270626c61a669d..2e96b4ceb950ba442e82686280cdea4272aa3eb0 100644 (file)
@@ -353,7 +353,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_
                int num;
                
                /* Free up temporary memory from the main smbd. */
-               lp_talloc_free();
+               lp_TALLOC_FREE();
 
                /* Ensure we respond to PING and DEBUG messages from the main smbd. */
                message_dispatch();
index 0fce677ea99a2de142277b2163ba57dd90805c14..5c4974329c79291c4349ebc9394622506360dc51 100644 (file)
@@ -399,7 +399,7 @@ static NTSTATUS find_forced_user(int snum, BOOL vuser_is_guest,
 
        result = NT_STATUS_OK;
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
@@ -487,7 +487,7 @@ static NTSTATUS find_forced_group(BOOL force_user,
 
        result = NT_STATUS_OK;
  done:
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return result;
 }
 
@@ -540,7 +540,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
                conn->uid = pass->pw_uid;
                conn->gid = pass->pw_gid;
                string_set(&conn->user,pass->pw_name);
-               talloc_free(pass);
+               TALLOC_FREE(pass);
                DEBUG(3,("Guest only user %s\n",user));
        } else if (vuser) {
                if (vuser->guest) {
index 11e52b03ab8f696838424d892d4b618a0153f28a..a429937f8d5e19ca36388553e0beec2484139e65 100644 (file)
@@ -161,13 +161,13 @@ BOOL token_contains_name_in_list(const char *username,
        while (*list != NULL) {
                if (token_contains_name(mem_ctx, username, sharename,
                                        token, *list)) {
-                       talloc_free(mem_ctx);
+                       TALLOC_FREE(mem_ctx);
                        return True;
                }
                list += 1;
        }
 
-       talloc_free(mem_ctx);
+       TALLOC_FREE(mem_ctx);
        return False;
 }
 
index 6e516d35628bfc3705c028f2bfed14aded539328..c62c9d928abac5b2e882269c277e8fc9b941ddc2 100644 (file)
@@ -72,7 +72,7 @@ BOOL change_to_guest(void)
        current_user.conn = NULL;
        current_user.vuid = UID_FIELD_INVALID;
 
-       talloc_free(pass);
+       TALLOC_FREE(pass);
        pass = NULL;
        
        return True;
@@ -251,7 +251,7 @@ BOOL change_to_user(connection_struct *conn, uint16 vuid)
         */
 
        if (must_free_token)
-               talloc_free(token);
+               TALLOC_FREE(token);
 
        current_user.conn = conn;
        current_user.vuid = vuid;
index 0e17cd6843d689b0961115f3069d0b87529ea985..3887fd9ae217a7874786a84318c2c3e8f2724934 100644 (file)
@@ -112,7 +112,7 @@ static BOOL net_sh_process(struct rpc_sh_ctx *ctx,
                if (strequal(argv[0], "..") &&
                    (this_ctx->parent != NULL)) {
                        new_ctx = this_ctx->parent;
-                       talloc_free(this_ctx);
+                       TALLOC_FREE(this_ctx);
                        this_ctx = new_ctx;
                        return True;
                }
@@ -250,7 +250,7 @@ int net_rpc_shell(int argc, const char **argv)
 
        cli_shutdown(ctx->cli);
 
-       talloc_free(ctx);
+       TALLOC_FREE(ctx);
 
        return 0;
 }
index c22f4b5e0982ba9fd49a5153ee95573e3a4e8c40..f99c9db35bfcdb332166cdbdd6b00a1a6533c3bc 100644 (file)
@@ -1481,7 +1481,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
                                                                (const unsigned char *)lm_key,
                                                                sizeof(lm_key));
                                        x_fprintf(x_stdout, "LANMAN-Session-Key: %s\n", hex_lm_key);
-                                       talloc_free(hex_lm_key);
+                                       TALLOC_FREE(hex_lm_key);
                                }
 
                                if (ntlm_server_1_user_session_key 
@@ -1491,7 +1491,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
                                                                          (const unsigned char *)user_session_key, 
                                                                          sizeof(user_session_key));
                                        x_fprintf(x_stdout, "User-Session-Key: %s\n", hex_user_session_key);
-                                       talloc_free(hex_user_session_key);
+                                       TALLOC_FREE(hex_user_session_key);
                                }
                        }
                }
@@ -1682,7 +1682,7 @@ static BOOL check_auth_crap(void)
                hex_lm_key = hex_encode(NULL, (const unsigned char *)lm_key,
                                        sizeof(lm_key));
                x_fprintf(x_stdout, "LM_KEY: %s\n", hex_lm_key);
-               talloc_free(hex_lm_key);
+               TALLOC_FREE(hex_lm_key);
        }
        if (request_user_session_key 
            && (memcmp(zeros, user_session_key, 
@@ -1690,7 +1690,7 @@ static BOOL check_auth_crap(void)
                hex_user_session_key = hex_encode(NULL, (const unsigned char *)user_session_key, 
                                                  sizeof(user_session_key));
                x_fprintf(x_stdout, "NT_KEY: %s\n", hex_user_session_key);
-               talloc_free(hex_user_session_key);
+               TALLOC_FREE(hex_user_session_key);
        }
 
         return True;
index a098039cd07996cc18e13f2f3b7d911b5b91c32d..2e7fbc1812d602d0a842108a67910e1a5eb794aa 100644 (file)
@@ -508,10 +508,10 @@ static int new_machine (struct pdb_methods *in, const char *machine_in)
        if ((pwd = getpwnam_alloc(NULL, machineaccount))) {
                if (!NT_STATUS_IS_OK(pdb_init_sam_pw( &sam_pwent, pwd))) {
                        fprintf(stderr, "Could not init sam from pw\n");
-                       talloc_free(pwd);
+                       TALLOC_FREE(pwd);
                        return -1;
                }
-               talloc_free(&pwd);
+               TALLOC_FREE(pwd);
        } else {
                if (!NT_STATUS_IS_OK(pdb_init_sam (&sam_pwent))) {
                        fprintf(stderr, "Could not init sam from pw\n");
index 405e51cd256bed247bf478cb8c8a52f6d4db790a..7e18e09dad5881138f5d46aab3c846d4ffdda29e 100644 (file)
@@ -151,7 +151,7 @@ static void pong_cb(int msg_type, struct process_id pid, void *buf, size_t len)
 {
        char *src_string = procid_str(NULL, &pid);
        printf("PONG from pid %s\n", src_string);
-       talloc_free(src_string);
+       TALLOC_FREE(src_string);
        num_replies++;
 }
 
index 9325c24881183e5216cfd251296f6101d4464092..a42361780eb4459693a7222e2dac2e105919ca7c 100644 (file)
@@ -331,7 +331,7 @@ static int process_root(int local_flags)
 
        if (!user_name[0] && (pwd = getpwuid_alloc(NULL, geteuid()))) {
                fstrcpy(user_name, pwd->pw_name);
-               talloc_free(pwd);
+               TALLOC_FREE(pwd);
        } 
 
        if (!user_name[0]) {
@@ -476,7 +476,7 @@ static int process_nonroot(int local_flags)
                pwd = getpwuid_alloc(NULL, getuid());
                if (pwd) {
                        fstrcpy(user_name,pwd->pw_name);
-                       talloc_free(pwd);
+                       TALLOC_FREE(pwd);
                } else {
                        fprintf(stderr, "smbpasswd: cannot lookup user name for uid %u\n", (unsigned int)getuid());
                        exit(1);
index 700fb7fa0808db8176b796c17c7dbfc8352010a8..d1cd38eb512321e2d7a5e1ba6a74b24b7e7e9963 100644 (file)
@@ -306,7 +306,7 @@ static void cgi_web_auth(void)
                       head, user, (int)geteuid(), (int)getuid(), tail);
                exit(0);
        }
-       talloc_free(pwd);
+       TALLOC_FREE(pwd);
 }
 
 
@@ -367,7 +367,7 @@ static BOOL cgi_handle_authorization(char *line)
                        
                        /* Save the users name */
                        C_user = SMB_STRDUP(user);
-                       talloc_free(pass);
+                       TALLOC_FREE(pass);
                        return True;
                }
        }
@@ -377,7 +377,7 @@ err:
                        "WWW-Authenticate: Basic realm=\"SWAT\"\r\n",
                        "username or password incorrect");
 
-       talloc_free(pass);
+       TALLOC_FREE(pass);
        return False;
 }