Handle memory allocation failure in make_non_terminals()

Thanks to Kristian Evensen for spotting the problem.
This commit is contained in:
Simon Kelley
2018-09-18 23:21:17 +01:00
parent ad03967ee4
commit ea6cc33804

View File

@@ -1434,6 +1434,8 @@ static void make_non_terminals(struct crec *source)
#endif
crecp = whine_malloc(sizeof(struct crec));
if (crecp)
{
*crecp = *source;
crecp->flags &= ~(F_IPV4 | F_IPV6 | F_CNAME | F_DNSKEY | F_DS | F_REVERSE);
crecp->flags |= F_NAMEP;
@@ -1442,6 +1444,7 @@ static void make_non_terminals(struct crec *source)
cache_hash(crecp);
}
}
}
#ifndef NO_ID
int cache_make_stat(struct txt_record *t)