2015-07-30 06:50:03

by Anchit Narang

[permalink] [raw]
Subject: [PATCH] tools/rctest: Closed File to fix memory leak

Closed the file before returning from do_send function.
---
tools/rctest.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/rctest.c b/tools/rctest.c
index bdc1eb5..a289368 100644
--- a/tools/rctest.c
+++ b/tools/rctest.c
@@ -559,6 +559,7 @@ static void do_send(int sk)
}
len = read(fd, buf, data_size);
send(sk, buf, len, 0);
+ close(fd);
return;
} else {
for (i = 6; i < data_size; i++)
--
1.7.9.5



2015-07-30 07:54:50

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] tools/rctest: Closed File to fix memory leak

Hi Anchit,

On Thu, Jul 30, 2015, Anchit Narang wrote:
> Closed the file before returning from do_send function.
> ---
> tools/rctest.c | 1 +
> 1 file changed, 1 insertion(+)

Applied. Thanks.

Johan