{
WERROR werr = WERR_OK;
NT_USER_TOKEN *token;
+ TALLOC_CTX *tmp_ctx = NULL;
if (path == NULL) {
DEBUG(1, ("Error: NULL path string given\n"));
goto done;
}
- token = registry_create_admin_token(mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
+ if (tmp_ctx == NULL) {
+ werr = WERR_NOMEM;
+ goto done;
+ }
+
+ token = registry_create_admin_token(tmp_ctx);
if (token == NULL) {
DEBUG(1, ("Error creating admin token\n"));
/* what is the appropriate error code here? */
}
done:
+ TALLOC_FREE(tmp_ctx);
return werr;
}