[SCTP] Fix leak in sctp_getsockopt_local_addrs when copy_to_user fails
authorVlad Yasevich <vladislav.yasevich@hp.com>
Wed, 23 May 2007 15:11:37 +0000 (11:11 -0400)
committerVladislav Yasevich <vxy@hera.kernel.org>
Wed, 13 Jun 2007 20:44:41 +0000 (20:44 +0000)
commitfe979ac169970b3d12facd6565766735862395c5
tree970e7093b9a86f9c6903871100a10faf62168a58
parent8b35805693e1915829355723537f99f1b8bc9cc0
[SCTP] Fix leak in sctp_getsockopt_local_addrs when copy_to_user fails

If the copy_to_user or copy_user calls fail in sctp_getsockopt_local_addrs(),
the function should free locally allocated storage before returning error.
Spotted by Coverity.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Acked-by: Sridhar Samudrala <sri@us.ibm.com>
net/sctp/socket.c