diff options
author | zhengbin <zhengbin13@huawei.com> | 2019-08-13 17:05:50 +0300 |
---|---|---|
committer | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-08-14 06:45:01 +0300 |
commit | 6d5afe20397b478192ed8c38ec0ee10fa3aec649 (patch) | |
tree | f6a5230b5b9e1db18a87a04dff665fcc961a5e53 | |
parent | d00ee64e1dcf09b3afefd1340f3e9eb637272714 (diff) | |
download | linux-6d5afe20397b478192ed8c38ec0ee10fa3aec649.tar.xz |
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>
-rw-r--r-- | net/sctp/stream.c | 1 |
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; } |