- struct static_lease *cur;
- struct static_lease *new_static_lease;
-
- /* Build new node */
- new_static_lease = xmalloc(sizeof(struct static_lease));
- new_static_lease->mac = mac;
- new_static_lease->ip = ip;
- new_static_lease->next = NULL;
-
- /* If it's the first node to be added... */
- if(*lease_struct == NULL)
- {
- *lease_struct = new_static_lease;
+ /* Find the tail of the list */
+ while ((st_lease = *st_lease_pp) != NULL) {
+ st_lease_pp = &st_lease->next;