break;
mta = xstrdup (by);
token = strtok(mta," \t");
- if (token == NULL)
+ if (token == NULL) {
+ free (mta);
break;
+ }
/* Now extract the last two components of the MTA host name
* as domain and tld.
*/
+ domain = tld = NULL;
while ((ptr = strsep (&token, delim)) != NULL) {
if (*ptr == '\0')
continue;
if (strcasestr(primary, domain)) {
free(mta);
- return primary;
- }
- for (i = 0; i < other_len; i++)
- if (strcasestr (other[i],domain)) {
- free(mta);
- return other[i];
+ return primary;
}
+ for (i = 0; i < other_len; i++)
+ if (strcasestr (other[i],domain)) {
+ free(mta);
+ return other[i];
+ }
}
free (mta);
}