link: Fix af_ops leak on ENOMEM
Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
506020ae99
commit
8b8e26b333
1 changed files with 3 additions and 1 deletions
|
@ -72,8 +72,10 @@ static struct rtnl_link_af_ops *af_lookup_and_alloc(struct rtnl_link *link,
|
|||
if (!af_ops)
|
||||
return NULL;
|
||||
|
||||
if (!(data = rtnl_link_af_alloc(link, af_ops)))
|
||||
if (!(data = rtnl_link_af_alloc(link, af_ops))) {
|
||||
rtnl_link_af_ops_put(af_ops);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return af_ops;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue