awslabs / aws-elasticache-cluster-client-libmemcached

Libmemcached library support for Amazon ElastiCache Memcached Cluster for PHP. The client is available at https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php.
Other
26 stars 24 forks source link

TLS: Free SSL context in memcached_quit #26

Closed barshaul closed 7 months ago

barshaul commented 7 months ago

When persistent ID is being used the php_memc_destroy destructor function isn't being called when the PHP Memcached struct is getting out of scope, so the memcached_st with all of its allocated structs aren't being freed. Instead, the user can call quit() to close all server connections when persistent ID is used. Therefore, this PR changes quit to also free the SSL context that is being stored in the memcached_st when quit is being called, to free all of the connections related TLS context.