summaryrefslogtreecommitdiff
path: root/source3/libgpo
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libgpo')
-rw-r--r--source3/libgpo/gpo_filesync.c4
-rw-r--r--source3/libgpo/gpo_ldap.c18
2 files changed, 14 insertions, 8 deletions
diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c
index 9f6557ef32..03d5286fae 100644
--- a/source3/libgpo/gpo_filesync.c
+++ b/source3/libgpo/gpo_filesync.c
@@ -166,7 +166,7 @@ static void gpo_sync_func(const char *mnt,
}
old_nt_dir = ctx->remote_path;
- ctx->remote_path = nt_dir;
+ ctx->remote_path = talloc_strdup(ctx->mem_ctx, nt_dir);
old_unix_dir = ctx->local_path;
ctx->local_path = talloc_strdup(ctx->mem_ctx, unix_dir);
@@ -174,7 +174,7 @@ static void gpo_sync_func(const char *mnt,
ctx->mask = talloc_asprintf(ctx->mem_ctx,
"%s\\*",
nt_dir);
- if (!ctx->local_path || !ctx->mask) {
+ if (!ctx->local_path || !ctx->mask || !ctx->remote_path) {
DEBUG(0,("gpo_sync_func: ENOMEM\n"));
return;
}
diff --git a/source3/libgpo/gpo_ldap.c b/source3/libgpo/gpo_ldap.c
index 7c59e8e5dc..4e63b92e4e 100644
--- a/source3/libgpo/gpo_ldap.c
+++ b/source3/libgpo/gpo_ldap.c
@@ -643,9 +643,12 @@ ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads,
token_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, 1);
ADS_ERROR_HAVE_NO_MEMORY(token_sids);
- if (!add_sid_to_array_unique(mem_ctx, &primary_group_sid, &token_sids,
- &num_token_sids)) {
- return ADS_ERROR(LDAP_NO_MEMORY);
+ status = ADS_ERROR_NT(add_sid_to_array_unique(mem_ctx,
+ &primary_group_sid,
+ &token_sids,
+ &num_token_sids));
+ if (!ADS_ERR_OK(status)) {
+ return status;
}
for (i = 0; i < num_ad_token_sids; i++) {
@@ -654,9 +657,12 @@ ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads,
continue;
}
- if (!add_sid_to_array_unique(mem_ctx, &ad_token_sids[i],
- &token_sids, &num_token_sids)) {
- return ADS_ERROR(LDAP_NO_MEMORY);
+ status = ADS_ERROR_NT(add_sid_to_array_unique(mem_ctx,
+ &ad_token_sids[i],
+ &token_sids,
+ &num_token_sids));
+ if (!ADS_ERR_OK(status)) {
+ return status;
}
}