Thread (4 messages) 4 messages, 4 authors, 2019-08-14

Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2019-08-14 00:11:31
Also in: linux-sctp

On Tue, Aug 13, 2019 at 10:05:50PM +0800, zhengbin wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
Signed-off-by: zhengbin <redacted>
---
 net/sctp/stream.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index 2594660..e83cdaa 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;
 	}
--
2.7.4
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help