From 98a7f9f6734dc8ece25aa98d16c979ec5b068777 Mon Sep 17 00:00:00 2001 From: TheFloW Date: Sun, 28 Jan 2018 14:38:03 +0100 Subject: [PATCH] Fixed bug where file descriptor wasn't closed when adhoc was canceled. --- adhoc_dialog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adhoc_dialog.c b/adhoc_dialog.c index 6cb0b01c..6be24c22 100644 --- a/adhoc_dialog.c +++ b/adhoc_dialog.c @@ -477,6 +477,8 @@ int receive_thread(SceSize args_size, ReceiveArguments *args) { if (cancelHandler()) { res = 0; free(buf); + sceIoClose(fddst); + sceIoRemove(dst_path); goto CANCELED; } @@ -485,6 +487,8 @@ int receive_thread(SceSize args_size, ReceiveArguments *args) { res = adhocRecv(server_socket, buf, &len); if (res < 0 && res != SCE_ERROR_NET_ADHOC_WOULD_BLOCK) { free(buf); + sceIoClose(fddst); + sceIoRemove(dst_path); goto CANCELED; } @@ -493,6 +497,8 @@ int receive_thread(SceSize args_size, ReceiveArguments *args) { if (written < 0) { res = written; free(buf); + sceIoClose(fddst); + sceIoRemove(dst_path); goto CANCELED; }