port the libstrongswan memory allocation methods to pluto

This commit is contained in:
Andreas Steffen
2009-04-17 07:11:29 +00:00
parent 5cac9e4c34
commit 67411e66c3
46 changed files with 463 additions and 549 deletions
+3 -3
View File
@@ -280,7 +280,7 @@ pfkey_get_response(pfkey_buf *buf, pfkey_seq_t seq)
{
/* Not for us: queue it. */
size_t bl = buf->msg.sadb_msg_len * IPSEC_PFKEYv2_ALIGN;
pfkey_item *it = alloc_bytes(offsetof(pfkey_item, buf) + bl, "pfkey_item");
pfkey_item *it = malloc(offsetof(pfkey_item, buf) + bl);
memcpy(&it->buf, buf, bl);
@@ -447,7 +447,7 @@ pfkey_dequeue(void)
pfkey_async(&it->buf);
pfkey_iq_head = it->next;
pfree(it);
free(it);
}
/* Handle any orphaned holds, but only if no pfkey input is pending.
@@ -898,7 +898,7 @@ pfkey_close(void)
pfkey_item *it = pfkey_iq_head;
pfkey_iq_head = it->next;
pfree(it);
free(it);
}
close(pfkeyfd);