projects
/
platform
/
core
/
appfw
/
aul-1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d13a740
)
Fix fd leak case
61/303861/2
author
Changgyu Choi
<changyu.choi@samsung.com>
Mon, 8 Jan 2024 01:40:50 +0000
(10:40 +0900)
committer
Changgyu Choi
<changyu.choi@samsung.com>
Mon, 8 Jan 2024 02:12:28 +0000
(11:12 +0900)
Change-Id: I46906a131388833e06f256be7845f65f0b45c244
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
aul/socket/server_socket.cc
patch
|
blob
|
history
diff --git
a/aul/socket/server_socket.cc
b/aul/socket/server_socket.cc
index
b5bbc9d
..
1a9136c
100644
(file)
--- a/
aul/socket/server_socket.cc
+++ b/
aul/socket/server_socket.cc
@@
-54,7
+54,14
@@
ClientSocket* ServerSocket::Accept() {
return nullptr;
}
- return new (std::nothrow) ClientSocket(client_fd);
+ ClientSocket* client = new (std::nothrow) ClientSocket(client_fd);
+ if (client == nullptr) {
+ _E("Out of memory");
+ close(client_fd);
+ return nullptr;
+ }
+
+ return client;
}
void ServerSocket::Bind(const std::string& bindpoint) {