summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorzhengbin <zhengbin13@huawei.com>2019-08-13 16:05:50 +0200
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-08-14 05:45:01 +0200
commit6d5afe20397b478192ed8c38ec0ee10fa3aec649 (patch)
treef6a5230b5b9e1db18a87a04dff665fcc961a5e53 /net/sctp
parentnetlink: Fix nlmsg_parse as a wrapper for strict message parsing (diff)
downloadlinux-6d5afe20397b478192ed8c38ec0ee10fa3aec649.tar.xz
linux-6d5afe20397b478192ed8c38ec0ee10fa3aec649.zip
sctp: fix memleak in sctp_send_reset_streams
If the stream outq is not empty, need to kfree nstr_list. Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream outq is empty") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/stream.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index 25946604af85..e83cdaa2ab76 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -316,6 +316,7 @@ int sctp_send_reset_streams(struct sctp_association *asoc,
nstr_list[i] = htons(str_list[i]);
if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) {
+ kfree(nstr_list);
retval = -EAGAIN;
goto out;
}