diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc.c | 7 | ||||
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 2 | ||||
-rw-r--r-- | source3/utils/net_status.c | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 0cedbd78ab..ada246e117 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -4094,6 +4094,9 @@ static void add_sid_to_token(NT_USER_TOKEN *token, DOM_SID *sid) return; token->user_sids = SMB_REALLOC_ARRAY(token->user_sids, DOM_SID, token->num_sids+1); + if (!token->user_sids) { + return; + } sid_copy(&token->user_sids[token->num_sids], sid); @@ -4477,6 +4480,10 @@ static void collect_share(const char *name, uint32 m, share_list->num_shares += 1; share_list->shares = SMB_REALLOC_ARRAY(share_list->shares, char *, share_list->num_shares); + if (!share_list->shares) { + share_list->num_shares = 0; + return; + } share_list->shares[share_list->num_shares-1] = SMB_STRDUP(name); } diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 05ff28ad65..d5fc4b5c58 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -1820,6 +1820,8 @@ static NTSTATUS fetch_database_to_ldif(struct rpc_pipe_client *pipe_hnd, num_deltas+num_alloced); if (groupmap == NULL || accountmap == NULL) { DEBUG(1,("GROUPMAP malloc failed\n")); + SAFE_FREE(groupmap); + SAFE_FREE(accountmap); return NT_STATUS_NO_MEMORY; } diff --git a/source3/utils/net_status.c b/source3/utils/net_status.c index d3b1bae276..d85bd27b16 100644 --- a/source3/utils/net_status.c +++ b/source3/utils/net_status.c @@ -130,6 +130,10 @@ static int collect_pid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, ids->num_entries += 1; ids->entries = SMB_REALLOC_ARRAY(ids->entries, struct sessionid, ids->num_entries); + if (!ids->entries) { + ids->num_entries = 0; + return 0; + } ids->entries[ids->num_entries-1] = sessionid; return 0; |