- macstring[strlen(macstring) - 1] = '\0';
-
- if (config.output_format[0] == 'X') {
- printf
- ("<active_lease>\n\t<ip>%s</ip>\n\t<macaddress>%s</macaddress>\n</active_lease>\n",
- ipstring, macstring);
- };
- }
-
- if ((num_leases > leasesmallocsize) ||
- (num_touches > touchesmallocsize) ||
- (num_backups > backupsmallocsize)) {
- printf("WARNING: running out of memory\n");
- printf("\tlease/touch/backup = %lu/%lu/%lu\n",
- leasesmallocsize, touchesmallocsize,
- backupsmallocsize);
- printf("\tlease/touch/backup = %lu/%lu/%lu\n",
- num_leases, num_touches, num_backups);
- printf
- ("Code should realloc() and init new memory, but no time to write that now!\n");
- exit(EXIT_FAILURE);
+ macstring[17] = '\0';
+ macaddr_p->ethernet = safe_strdup(macstring);
+ macaddr_p->ip = safe_strdup(ipstring);
+ macaddr_p->next =
+ safe_malloc(sizeof(struct macaddr_t));
+ macaddr_p = macaddr_p->next;
+ macaddr_p->next = NULL;