aboutsummaryrefslogtreecommitdiffstats
path: root/src/pluto/server.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-04-17 07:11:29 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-04-17 07:11:29 +0000
commit67411e66c3ce7767e2178d613559e01999820771 (patch)
tree6fd577a4bbc1435f34e13451b2fe481bece2f6d5 /src/pluto/server.c
parent5cac9e4c3463fb83dfd2908006256dec1205f409 (diff)
downloadstrongswan-67411e66c3ce7767e2178d613559e01999820771.tar.bz2
strongswan-67411e66c3ce7767e2178d613559e01999820771.tar.xz
port the libstrongswan memory allocation methods to pluto
Diffstat (limited to 'src/pluto/server.c')
-rw-r--r--src/pluto/server.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/pluto/server.c b/src/pluto/server.c
index cae16294e..3b2529286 100644
--- a/src/pluto/server.c
+++ b/src/pluto/server.c
@@ -170,10 +170,10 @@ free_dead_ifaces(void)
if (p->change == IFN_DELETE)
{
*pp = p->next; /* advance *pp */
- pfree(p->vname);
- pfree(p->rname);
+ free(p->vname);
+ free(p->rname);
close(p->fd);
- pfree(p);
+ free(p);
}
else
{
@@ -310,7 +310,7 @@ find_raw_ifaces4(void)
DBG(DBG_CONTROL, DBG_log("found %s with address %s"
, ri.name, ip_str(&ri.addr)));
ri.next = rifaces;
- rifaces = clone_thing(ri, "struct raw_iface");
+ rifaces = clone_thing(ri);
}
close(master_sock);
@@ -393,7 +393,7 @@ find_raw_ifaces6(void)
, DBG_log("found %s with address %s"
, ri.name, sb));
ri.next = rifaces;
- rifaces = clone_thing(ri, "struct raw_iface");
+ rifaces = clone_thing(ri);
}
}
fclose(proc_sock);
@@ -663,9 +663,10 @@ add_entry:
nat_traversal_espinudp_socket(fd, ESPINUDP_WITH_NON_IKE);
}
- q = alloc_thing(struct iface, "struct iface");
- q->rname = clone_str(ifp->name, "real device name");
- q->vname = clone_str(v->name, "virtual device name");
+ q = malloc_thing(struct iface);
+ zero(q);
+ q->rname = clone_str(ifp->name);
+ q->vname = clone_str(v->name);
q->addr = ifp->addr;
q->fd = fd;
q->next = interfaces;
@@ -682,9 +683,10 @@ add_entry:
break;
nat_traversal_espinudp_socket(fd,
ESPINUDP_WITH_NON_ESP);
- q = alloc_thing(struct iface, "struct iface");
- q->rname = clone_str(ifp->name, "real device name");
- q->vname = clone_str(v->name, "virtual device name");
+ q = malloc_thing(struct iface);
+ zero(q);
+ q->rname = clone_str(ifp->name);
+ q->vname = clone_str(v->name);
q->addr = ifp->addr;
setportof(htons(NAT_T_IKE_FLOAT_PORT), &q->addr);
q->fd = fd;
@@ -731,7 +733,7 @@ add_entry:
struct raw_iface *t = rifaces;
rifaces = t->next;
- pfree(t);
+ free(t);
}
}