Copy hostname so it stays valid after config loading finishes
[trust_router.git] / common / tr_idp.c
index 10bb2c3..984e6b5 100644 (file)
@@ -35,7 +35,7 @@
 #include <talloc.h>
 #include <time.h>
 
-#include <trust_router/tr_name.h>
+#include <tr_name_internal.h>
 #include <tr_idp.h>
 #include <tr_config.h>
 #include <tr_debug.h>
@@ -139,6 +139,7 @@ TR_IDP_REALM *tr_idp_realm_new(TALLOC_CTX *mem_ctx)
     idp->aaa_servers=NULL;
     idp->apcs=NULL;
     idp->origin=TR_REALM_LOCAL;
+    idp->refcount=0;
     talloc_set_destructor((void *)idp, tr_idp_realm_destructor);
   }
   return idp;
@@ -344,11 +345,11 @@ char *tr_idp_realm_to_str(TALLOC_CTX *mem_ctx, TR_IDP_REALM *idp)
   }
 
   result=talloc_asprintf(mem_ctx,
-                         "IDP realm: \"%.*s\"\n"
-                         "  shared: %s\n"
-                         "  local: %s\n"
-                         "  AAA servers: %s\n"
-                         "  APCs: %s\n",
+                         "IDP realm: \"%.*s\""
+                         "  shared: %s"
+                         "  local: %s"
+                         "  AAA servers: %s"
+                         "  APCs: %s",
                          idp->realm_id->len, idp->realm_id->buf,
                          (idp->shared_config)?"yes":"no",
                          (idp->origin==TR_REALM_LOCAL)?"yes":"no",