mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 13:22:48 +00:00
malloc() may return NULL.
Obtained from: KAME MFC after: 1 week
This commit is contained in:
parent
5912967938
commit
d7f0819bf0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118831
@ -112,6 +112,11 @@ getconfig(intface)
|
||||
}
|
||||
|
||||
tmp = (struct rainfo *)malloc(sizeof(*ralist));
|
||||
if (tmp == NULL) {
|
||||
syslog(LOG_INFO, "<%s> %s: can't allocate enough memory",
|
||||
__func__, intface);
|
||||
exit(1);
|
||||
}
|
||||
memset(tmp, 0, sizeof(*tmp));
|
||||
tmp->prefix.next = tmp->prefix.prev = &tmp->prefix;
|
||||
tmp->route.next = tmp->route.prev = &tmp->route;
|
||||
|
Loading…
Reference in New Issue
Block a user