plugins: Fix resource leak in connect_socket()
PATCH 1/2 plugins: Fix resource leak in connect_socket()
Close the fd when connect() fails.
Reported-by Euler Robot <[email protected]>
Signed-off-by AlexChen <[email protected]>
--- contrib/plugins/lockstep.c | 1 + 1 file changed, 1 insertion(+)
contrib/plugins/lockstep.c +1 -0
@@ -292,6 +292,7 @@ static bool connect_socket(const char *path)if (connect (fd, (struct sockaddr *)&sockaddr,sizeof (sockaddr)) <0 ) {perror ("failed to connect" ); +close (fd);return false; }
Signature · 1 line
2.19.1
Kindly ping.
Quoted 20 lines · AlexChen
Close the fd when
connect()fails.Reported-by Euler Robot <[email protected]>Signed-off-by AlexChen <[email protected]>--- contrib/plugins/lockstep.c | 1 + 1 file changed, 1 insertion(+)contrib/plugins/lockstep.c +1
-0@@ -292,6 +292,7 @@ static bool connect_socket(const char *path)if (connect (fd, (struct sockaddr *)&sockaddr,sizeof (sockaddr)) <0 ) {perror ("failed to connect" ); +close (fd);return false; }
Quoted 1 line · AlexChen
Kindly ping.
Ahh sorry I missed these. Was there a cover letter for the series?
Quoted 22 lines · AlexChen
Quoted 20 lines
Close the fd when
connect()fails.Reported-by Euler Robot <[email protected]>Signed-off-by AlexChen <[email protected]>--- contrib/plugins/lockstep.c | 1 + 1 file changed, 1 insertion(+)contrib/plugins/lockstep.c +1
-0@@ -292,6 +292,7 @@ static bool connect_socket(const char *path)if (connect (fd, (struct sockaddr *)&sockaddr,sizeof (sockaddr)) <0 ) {perror ("failed to connect" ); +close (fd);return false; }
Signature · 1 line
Alex Bennée
Quoted 7 lines · Alex Bennée
Quoted 1 line · AlexChen
Kindly ping.
Ahh sorry I missed these. Was there a cover letter for the series?
I forgot to send the cover letter, I will send the patch V2 with the cover letter.
Thanks,
Alex Chen