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:
parent
459759a037
commit
17f513956a
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue