1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

if: fix access of uninitialized memory

This commit is contained in:
Steffen Vogel 2020-07-16 14:04:53 +02:00
parent 459759a037
commit 17f513956a

View file

@ -48,7 +48,7 @@ int if_init(struct interface *i, struct rtnl_link *link)
debug(LOG_IF | 3, "Created interface '%s'", if_name(i));
int n = if_get_irqs(i);
int n = if_get_irqs(i);
if (n > 0)
debug(6, "Found %u IRQs for interface '%s'", n, if_name(i));
else
@ -166,6 +166,8 @@ struct interface * if_get_egress(struct sockaddr *sa, struct vlist *interfaces)
if (!i)
throw MemoryAllocationError();
memset(i, 0, sizeof(struct interface));
ret = if_init(i, link);
if (ret)
return nullptr;