diff options
-rw-r--r-- | lib/packet.c | 13 |
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); +} |