libgpo: Fix some minor issues.
authorGünther Deschner <gd@samba.org>
Mon, 20 Apr 2009 17:15:32 +0000 (19:15 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 20 Apr 2009 21:16:17 +0000 (23:16 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
libgpo/gpo_fetch.c
libgpo/gpo_ini.c

index beedfc228013003df637f967c067b377f02f93b2..06c730cfa38404bc697bcbe247e85db0d0f5f7d0 100644 (file)
@@ -114,7 +114,7 @@ static NTSTATUS gpo_prepare_local_store(TALLOC_CTX *mem_ctx,
        }
 
        while (next_token_talloc(mem_ctx, &unix_path, &tok, "/")) {
-               if (strequal(tok, cache_dir)) {
+               if (strequal(tok, GPO_CACHE_DIR)) {
                        break;
                }
        }
@@ -212,6 +212,7 @@ NTSTATUS gpo_fetch_files(TALLOC_CTX *mem_ctx,
 
 
        result = gpo_connect_server(ads, lp_ctx, server, service, &cli);
+       NT_STATUS_NOT_OK_RETURN(result);
 
 
        result = gpo_prepare_local_store(mem_ctx, cache_dir, unix_path);
index af2b88c0b8a311f702d6ed7403641b3ea9ecc65b..674c741bbac1ec3d4da5c8baf225c097d2624ab5 100644 (file)
@@ -42,6 +42,7 @@ static bool store_keyval_pair(const char *key, const char *value, void *ctx_ptr)
 {
        struct gp_inifile_context *ctx = (struct gp_inifile_context *) ctx_ptr;
        ctx->data = talloc_realloc(ctx, ctx->data, struct keyval_pair *, ctx->keyval_count+1);
+       ctx->data[ctx->keyval_count] = talloc_zero(ctx, struct keyval_pair);
        ctx->data[ctx->keyval_count]->key = talloc_asprintf(ctx, "%s:%s", ctx->current_section, key);
        ctx->data[ctx->keyval_count]->val = talloc_strdup(ctx, value);
        ctx->keyval_count++;