summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/usertools.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c
index a3d210e3..3b23b6a7 100644
--- a/src/util/usertools.c
+++ b/src/util/usertools.c
@@ -292,19 +292,22 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx,
rname = only_name;
}
- if (rdomain != NULL)
- *domain = talloc_steal(memctx, rdomain);
- if (rname != NULL)
- *name = talloc_steal(memctx, rname);
-
- talloc_free(tmp_ctx);
-
if (rdomain == NULL && rname == NULL) {
DEBUG(SSSDBG_TRACE_FUNC,
("name '%s' did not match any domain's expression\n", orig));
return EINVAL;
}
+ if (domain != NULL) {
+ *domain = talloc_steal(memctx, rdomain);
+ }
+
+ if (name != NULL) {
+ *name = talloc_steal(memctx, rname);
+ }
+
+ talloc_free(tmp_ctx);
+
return EOK;
}