summaryrefslogtreecommitdiff
path: root/lib/packet.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-14 13:32:59 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-14 13:32:59 +0100
commit963d7950fd7eeff9e2bafb4154ca83ed66c2f748 (patch)
tree091a1a223fbe5fae8303468775837f3da968ca9d /lib/packet.c
parentcef9bf7b7340b7270eb979294aeb186d741e6318 (diff)
(rs_packet_destroy): Free unconditionally.
Diffstat (limited to 'lib/packet.c')
-rw-r--r--lib/packet.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/packet.c b/lib/packet.c
index 3519c1c..a7e09f6 100644
--- a/lib/packet.c
+++ b/lib/packet.c
@@ -188,11 +188,10 @@ rs_packet_frpkt (struct rs_packet *pkt)
void
rs_packet_destroy (struct rs_packet *pkt)
{
- if (pkt)
- {
- // FIXME: memory leak! TODO: free all attributes
- rad_free (&pkt->rpkt);
- rs_free (pkt->conn->ctx, pkt);
- }
-}
+ assert (pkt);
+ assert (pkt->conn);
+ assert (pkt->conn->ctx);
+ rad_free (&pkt->rpkt); /* Note: This frees the VALUE_PAIR's too. */
+ rs_free (pkt->conn->ctx, pkt);
+}