diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/unexpected.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c index 7ec5800e69..4543ffe7c6 100644 --- a/source3/libsmb/unexpected.c +++ b/source3/libsmb/unexpected.c @@ -481,6 +481,15 @@ static void nb_packet_server_listener(struct tevent_context *ev, DLIST_ADD(server->clients, client); server->num_clients += 1; + + if (server->num_clients > server->max_clients) { + DEBUG(10, ("Too many clients, dropping oldest\n")); + + /* + * no TALLOC_FREE here, don't mess with the list structs + */ + talloc_free(server->clients->prev); + } } static ssize_t nb_packet_client_more(uint8_t *buf, size_t buflen, |