From d0ab8c0e7beb33c3a2f31c735a56a58277038be1 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 12 Feb 2022 12:44:02 +0100 Subject: [PATCH] Fix double adb tunnel closing On error, close the adb tunnel only if it has not already been closed beforehand. --- app/src/server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/server.c b/app/src/server.c index 0de51c7e..a4090f00 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -482,8 +482,10 @@ fail: } } - // Always leave this function with tunnel disabled - sc_adb_tunnel_close(tunnel, &server->intr, serial); + if (tunnel->enabled) { + // Always leave this function with tunnel disabled + sc_adb_tunnel_close(tunnel, &server->intr, serial); + } return false; }