struct GROUP_POLICY_OBJECT *gpo;
NTSTATUS result;
struct security_token *token = NULL;
+ char *gpo_cache_path;
if (argc < 1 || c->display_usage) {
d_printf("%s\n%s\n%s",
d_printf(_("finished\n"));
d_printf(_("* Refreshing Group Policy Data "));
- if (!NT_STATUS_IS_OK(result = check_refresh_gpo_list(ads, mem_ctx,
- cache_path(GPO_CACHE_DIR),
- flags,
- gpo_list))) {
+ gpo_cache_path = cache_path(GPO_CACHE_DIR);
+ if (gpo_cache_path == NULL) {
+ d_printf(_("failed: %s\n"), nt_errstr(NT_STATUS_NO_MEMORY));
+ goto out;
+ }
+ result = check_refresh_gpo_list(ads, mem_ctx,
+ gpo_cache_path,
+ flags,
+ gpo_list);
+ TALLOC_FREE(gpo_cache_path);
+ if (!NT_STATUS_IS_OK(result)) {
d_printf(_("failed: %s\n"), nt_errstr(result));
goto out;
}