malloc() may return NULL.
Obtained from: KAME MFC after: 1 week
This commit is contained in:
parent
5912967938
commit
d7f0819bf0
@ -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