Skip to content

Commit

Permalink
Fixed bug where file descriptor wasn't closed when adhoc was canceled.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Jan 28, 2018
1 parent 26a380c commit 98a7f9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adhoc_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 98a7f9f

Please sign in to comment.