mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
sctp: fix memleak in sctp_send_reset_streams
If the stream outq is not empty, need to kfree nstr_list.
Fixes: d570a59c5b
("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>
This commit is contained in:
parent
d00ee64e1d
commit
6d5afe2039
1 changed files with 1 additions and 0 deletions
|
@ -316,6 +316,7 @@ int sctp_send_reset_streams(struct sctp_association *asoc,
|
||||||
nstr_list[i] = htons(str_list[i]);
|
nstr_list[i] = htons(str_list[i]);
|
||||||
|
|
||||||
if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) {
|
if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) {
|
||||||
|
kfree(nstr_list);
|
||||||
retval = -EAGAIN;
|
retval = -EAGAIN;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue