summaryrefslogtreecommitdiff
path: root/lib/radius/valuepair.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/radius/valuepair.c')
-rw-r--r--lib/radius/valuepair.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/radius/valuepair.c b/lib/radius/valuepair.c
index b374fdd..6277f7d 100644
--- a/lib/radius/valuepair.c
+++ b/lib/radius/valuepair.c
@@ -35,17 +35,13 @@ void nr_vp_free(VALUE_PAIR **head)
{
VALUE_PAIR *next, *vp;
- if (!head || !*head) return;
-
- vp = *head;
- do {
- if (vp) next = vp->next;
+ for (vp = *head; vp != NULL; vp = next) {
+ next = vp->next;
if (vp->da->flags.encrypt) {
memset(vp, 0, sizeof(vp));
}
free(vp);
- vp = next;
- } while (next);
+ }
*head = NULL;
}