Skip to content
Commit 9783ccd0 authored by Gao Feng's avatar Gao Feng Committed by David S. Miller
Browse files

net: Fix one possible memleak in ip_setup_cork



It would allocate memory in this function when the cork->opt is NULL. But
the memory isn't freed if failed in the latter rt check, and return error
directly. It causes the memleak if its caller is ip_make_skb which also
doesn't free the cork->opt when meet a error.

Now move the rt check ahead to avoid the memleak.

Signed-off-by: default avatarGao Feng <gfree.wind@vip.163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5171b37d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment