diff --git a/native/src/core/daemon.cpp b/native/src/core/daemon.cpp index e10a122cf..b30a73650 100644 --- a/native/src/core/daemon.cpp +++ b/native/src/core/daemon.cpp @@ -447,12 +447,15 @@ int connect_daemon(int req, bool create) { break; case MainResponse::ERROR: LOGE("Daemon error\n"); + close(fd); return -1; case MainResponse::ROOT_REQUIRED: LOGE("Root is required for this operation\n"); + close(fd); return -1; case MainResponse::ACCESS_DENIED: LOGE("Access denied\n"); + close(fd); return -1; default: __builtin_unreachable();