From 73edb20e690b6f0f4e7671c1caa52ce03d24a78c Mon Sep 17 00:00:00 2001 From: Munkyu Im Date: Wed, 30 Dec 2015 11:04:11 +0900 Subject: [PATCH] net: close socket after checking available port fixed check_port_bind_listen() in 6ae322880b2a6f4de42bd25c9f19ccce870136cd But one caller of this function was skipped closing socket. So, this commit adds socket close. Change-Id: Id204f7e3bd15111019ae86cbacaa75111edd59fd Signed-off-by: Munkyu Im (cherry picked from commit 4927bf7af5912f8ab4c2cf4b10a259ef5ef85f3b) (cherry picked from commit 379fad4bf085164611a3b1d68e4d7f95a85b88da) --- tizen/src/util/osutil-linux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tizen/src/util/osutil-linux.c b/tizen/src/util/osutil-linux.c index c3e318ee2f..4795998751 100644 --- a/tizen/src/util/osutil-linux.c +++ b/tizen/src/util/osutil-linux.c @@ -43,6 +43,7 @@ #include #include +#include "qemu/sockets.h" #include "qemu/error-report.h" #include "osutil.h" @@ -84,8 +85,10 @@ void check_vm_lock_os(void) shm_info.shm_nattch); if ((shm_info.shm_nattch > 0) && g_strcmp0(get_drive_image_file(), (char *)shm_addr) == 0) { - if (check_port_bind_listen(port + 1) > 0) { + int ret = 0; + if ((ret = check_port_bind_listen(port + 1)) > 0) { shmdt(shm_addr); + closesocket(ret); continue; } shmdt(shm_addr); -- 2.34.1