mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
netgraph/bridge: malloc without flags
During tests an assert was triggered and pointed to missing flags in
the newlink function of ng_bridge(4).
Reported by: markj
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D30759
(cherry picked from commit 4c3280e587)
This commit is contained in:
parent
07ef7a0349
commit
ad2c95130b
1 changed files with 1 additions and 3 deletions
|
|
@ -395,9 +395,7 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name)
|
|||
if(NG_PEER_NODE(hook) == node)
|
||||
return (ELOOP);
|
||||
|
||||
link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_ZERO);
|
||||
if (link == NULL)
|
||||
return (ENOMEM);
|
||||
link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_WAITOK | M_ZERO);
|
||||
|
||||
link->stats.recvOctets = counter_u64_alloc(M_WAITOK);
|
||||
link->stats.recvPackets = counter_u64_alloc(M_WAITOK);
|
||||
|
|
|
|||
Loading…
Reference in a new issue