Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

zhengbin and committed by
Jakub Kicinski
6d5afe20 d00ee64e

+1
+1
net/sctp/stream.c
··· 316 316 nstr_list[i] = htons(str_list[i]); 317 317 318 318 if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) { 319 + kfree(nstr_list); 319 320 retval = -EAGAIN; 320 321 goto out; 321 322 }