summaryrefslogtreecommitdiff
path: root/lib/resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/resource.c')
-rw-r--r--lib/resource.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/resource.c b/lib/resource.c
index 2071a411..e0aaac0a 100644
--- a/lib/resource.c
+++ b/lib/resource.c
@@ -51,6 +51,9 @@ rp_init(pool *z, struct domain_generic *dom, const char *name)
{
ASSERT_DIE(DG_IS_LOCKED(dom));
+ if (name && !domain_name(dom))
+ domain_setup(dom, name, z);
+
z->name = name;
z->domain = dom;
z->inside = (TLIST_LIST(resource)) {};
@@ -87,7 +90,9 @@ pool *
rp_vnewf(pool *p, struct domain_generic *dom, const char *fmt, va_list args)
{
pool *z = rp_new(p, dom, NULL);
- z->name = mb_vsprintf(p, fmt, args);
+ z->name = mb_vsprintf(z, fmt, args);
+ if (!domain_name(dom))
+ domain_setup(dom, z->name, z);
return z;
}