af_key: Fix memory leak in key_notify_policy.
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 10 Jan 2018 08:33:26 +0000 (09:33 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 10 Jan 2018 08:45:11 +0000 (09:45 +0100)
commit1e532d2b49645e7cb76d5af6cb5bc4ec93d861ae
tree511cdfd2168fbdd9c5ab32573fca8c4e9299fc45
parent374d1b5a81f7f9cc5e7f095ac3d5aff3f6600376
af_key: Fix memory leak in key_notify_policy.

We leak the allocated out_skb in case
pfkey_xfrm_policy2msg() fails. Fix this
by freeing it on error.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/key/af_key.c