Skip to content

Commit e2d023a

Browse files
authored
Fix double free in socket pool on unexpected photon thread switch (#1027)
1 parent ab82ede commit e2d023a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/pooled_socket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ class TCPSocketPool : public ForwardSocketClient {
158158
list.erase(node);
159159
if (list.empty()) fdmap.erase(it);
160160
rm_watch(node);
161-
delete node;
162161
}
163162

164163
public:
@@ -246,6 +245,7 @@ class TCPSocketPool : public ForwardSocketClient {
246245
// socket shutdown
247246
drop_from_pool(nodes[i]);
248247
}
248+
for (int i = 0; i < ret; i++) delete nodes[i];
249249
}
250250
}
251251
};

0 commit comments

Comments
 (0)