From b46913fb95d59f3ec8e7e71da758cd16cda05f2c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Dec 2004 21:14:28 +0000 Subject: r4291: More *alloc fixes inspired by Albert Chin (china@thewrittenword.com). Jeremy (This used to be commit efc1b688cf9b1a17f1a6bf46d481280ed8bd0c46) --- source3/utils/editreg.c | 7 ++++++- source3/utils/net_rpc_samsync.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c index fa930b163a..9123de18c8 100644 --- a/source3/utils/editreg.c +++ b/source3/utils/editreg.c @@ -302,6 +302,7 @@ Hope this helps.... (Although it was "fun" for me to uncover this things, *************************************************************************/ +#ifdef STANDALONE #include #include #include @@ -315,6 +316,10 @@ Hope this helps.... (Although it was "fun" for me to uncover this things, #define False 0 #define True 1 +#else /* STANDALAONE */ +#include "includes.h" +#endif /* STANDALONE */ + #define REG_KEY_LIST_SIZE 10 /* @@ -1900,7 +1905,7 @@ SEC_DESC *process_sec_desc(REGF *regf, REG_SEC_DESC *sec_desc) { SEC_DESC *tmp = NULL; - tmp = (SEC_DESC *)malloc(sizeof(SEC_DESC)); + tmp = SMB_MALLOC_P(SEC_DESC); if (!tmp) { return NULL; diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 3c98ec9e71..e8a110d083 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -863,7 +863,7 @@ fetch_alias_mem(uint32 rid, SAM_ALIAS_MEM_INFO *delta, DOM_SID dom_sid) return NT_STATUS_NO_MEMORY; } - nt_members = talloc_zero(t, sizeof(char *) * delta->num_members); + nt_members = TALLOC_ZERO_ARRAY(t, char *, delta->num_members); for (i=0; inum_members; i++) { NTSTATUS nt_status; -- cgit