Merge pull request #72 from painless-security/jennifer/peer_label_for_updates
[trust_router.git] / common / tr_apc.c
index bb37a10..8f590e8 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <talloc.h>
 
-#include <trust_router/tr_name.h>
+#include <tr_name_internal.h>
 #include <tr_apc.h>
 #include <tr_debug.h>
 
@@ -101,9 +101,12 @@ TR_APC *tr_apc_dup(TALLOC_CTX *mem_ctx, TR_APC *apc)
 {
   TALLOC_CTX *tmp_ctx=talloc_new(NULL);
   TR_APC *cur=NULL;
-  TR_APC *new=tr_apc_dup(tmp_ctx, apc);
+  TR_APC *new=NULL;
 
-  if (new==NULL)
+  if (apc==NULL)
+    return NULL;
+
+  if (NULL==(new=tr_apc_dup_one(tmp_ctx, apc)))
     return NULL;
   
   for (cur=new,apc=apc->next; apc!=NULL; cur=cur->next,apc=apc->next) {