Commit 9474750b authored by 石松洲's avatar 石松洲 Committed by John Wu

Close fd of erroneous daemon socket connections

parent e86db0bd
...@@ -447,12 +447,15 @@ int connect_daemon(int req, bool create) { ...@@ -447,12 +447,15 @@ int connect_daemon(int req, bool create) {
break; break;
case MainResponse::ERROR: case MainResponse::ERROR:
LOGE("Daemon error\n"); LOGE("Daemon error\n");
close(fd);
return -1; return -1;
case MainResponse::ROOT_REQUIRED: case MainResponse::ROOT_REQUIRED:
LOGE("Root is required for this operation\n"); LOGE("Root is required for this operation\n");
close(fd);
return -1; return -1;
case MainResponse::ACCESS_DENIED: case MainResponse::ACCESS_DENIED:
LOGE("Access denied\n"); LOGE("Access denied\n");
close(fd);
return -1; return -1;
default: default:
__builtin_unreachable(); __builtin_unreachable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment