projects
/
platform
/
core
/
appfw
/
component-based-application.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e443daf
)
Fix fd leak case
60/303860/1
author
Changgyu Choi
<changyu.choi@samsung.com>
Mon, 8 Jan 2024 01:40:23 +0000
(10:40 +0900)
committer
Changgyu Choi
<changyu.choi@samsung.com>
Mon, 8 Jan 2024 01:40:23 +0000
(10:40 +0900)
Change-Id: I6a8db3277d648c779393d54145a6a353436e792a
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
component_based/port/server.cc
patch
|
blob
|
history
diff --git
a/component_based/port/server.cc
b/component_based/port/server.cc
index 9d59c7902ecfc8f64e037c549bed357e2e144421..a1b0c003fdd4cd953eadec6377181c9549a75f60 100644
(file)
--- a/
component_based/port/server.cc
+++ b/
component_based/port/server.cc
@@
-120,7
+120,14
@@
Client* Server::Accept() {
}
_W("client pid(%d), uid(%u)", cred.pid, cred.uid);
- return new (std::nothrow) Client(client_fd, cred.pid);
+ Client* client = new (std::nothrow) Client(client_fd, cred.pid);
+ if (client == nullptr) {
+ _E("Out of memory");
+ close(client_fd);
+ return nullptr;
+ }
+
+ return client;
}
int Server::CheckPrivilege(int fd) {